- Timestamp:
- Feb 20, 2008, 3:58:50 PM (17 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r695 r696 483 483 // --------------------- 484 484 if ( begCorrupt && !endCorrupt && secSucc > _adviseReco * 60 ) { 485 _endDateCor = QDateTime::currentDateTime().toUTC().date().toString("dd-MM-yy"); 486 _endTimeCor = QDateTime::currentDateTime().toUTC().time().toString("hh:mm:ss"); 485 487 emit(newMessage(_staID + ": Corrupted recovery threshold exceeded")); 486 callScript( "End_Corrupted");488 callScript(("End_Corrupted " + _endDateCor + " " + _endTimeCor + " Begin was " + _begDateCor + " " + _begTimeCor).toAscii()); 487 489 endCorrupt = true; 488 490 begCorrupt = false; … … 494 496 // ----------------------- 495 497 if ( !begCorrupt && secFail > _adviseFail * 60 ) { 498 _begDateCor = QDateTime::currentDateTime().toUTC().date().toString("dd-MM-yy"); 499 _begTimeCor = QDateTime::currentDateTime().toUTC().time().toString("hh:mm:ss"); 496 500 emit(newMessage(_staID + ": Corrupted failure threshold exceeded")); 497 callScript( "Begin_Corrupted");501 callScript(("Begin_Corrupted " + _begDateCor + " " + _begTimeCor).toAscii()); 498 502 begCorrupt = true; 499 503 endCorrupt = false; … … 513 517 _decodeStart.setTime(QTime()); 514 518 if (_inspSegm>0) { 519 _endDateOut = QDateTime::currentDateTime().toUTC().date().toString("dd-MM-yy"); 520 _endTimeOut = QDateTime::currentDateTime().toUTC().time().toString("hh:mm:ss"); 515 521 emit(newMessage(_staID + ": Outage recovery threshold exceeded")); 516 callScript( "End_Outage");522 callScript(("End_Outage " + _endDateOut + " " + _endTimeOut + " Begin was " + _begDateOut + " " + _begTimeOut).toAscii()); 517 523 } 518 524 } … … 619 625 _decodeStop.setTime(QTime()); 620 626 if (_inspSegm>0) { 627 _begDateOut = QDateTime::currentDateTime().toUTC().date().toString("dd-MM-yy"); 628 _begTimeOut = QDateTime::currentDateTime().toUTC().time().toString("hh:mm:ss"); 621 629 emit(newMessage(_staID + ": Outage failure threshold exceeded")); 622 callScript( "Begin_Outage");630 callScript(("Begin_Outage " + _begDateOut + " " + _begTimeOut).toAscii()); 623 631 } 624 632 } -
trunk/BNC/bncgetthread.h
r686 r696 76 76 QByteArray _nmea; 77 77 QString _adviseScript; 78 QString _begDateCor; 79 QString _begTimeCor; 80 QString _begDateOut; 81 QString _begTimeOut; 82 QString _endDateCor; 83 QString _endTimeCor; 84 QString _endDateOut; 85 QString _endTimeOut; 78 86 int _obsRate; 79 87 int _inspSegm; -
trunk/BNC/bnchelp.html
r694 r696 411 411 <p><a name="advscript"><h4>3.8.4 Advisory Script - optional </h4></p> 412 412 <p> 413 As mentioned previously, BNC can trigger a shell script or a batch file to be executed when one of the events described are reported. This script can be used to email an advisory note to network operator or stream providers. To enable this feature, specify the full path to the script or batch file in the 'Script' field. The affected mountpoint and type of event reported ('Begin_Outage', 'End_Outage', 'Begin_Corrupted' or 'End_Corrupted') will then be passed on to the script as command line parameters (\%1 and \%2 on Windows systems or \$1 and \$2 on U NIX/Linuxsystems).413 As mentioned previously, BNC can trigger a shell script or a batch file to be executed when one of the events described are reported. This script can be used to email an advisory note to network operator or stream providers. To enable this feature, specify the full path to the script or batch file in the 'Script' field. The affected mountpoint and type of event reported ('Begin_Outage', 'End_Outage', 'Begin_Corrupted' or 'End_Corrupted') will then be passed on to the script as command line parameters (\%1 and \%2 on Windows systems or \$1 and \$2 on Unix/Linux systems). 414 414 </p> 415 415 <p> … … 422 422 #!/bin/bash 423 423 sleep $((60*RANDOM/32767)) 424 cat | mail -s " BNC: $2 Stream$1" email@address <<!424 cat | mail -s "NABU: $1" email@address <<! 425 425 Advisory Note to BNC User, 426 Please note a $2 advisory from BNC for stream $1 dated `date`. 426 Please note the following advisory received from BNC. 427 Stream: $* 427 428 Regards, BNC 428 429 !
Note:
See TracChangeset
for help on using the changeset viewer.