Add a 10 second wait to force alarm on. If the monitor doesn't notice it is likely not running, leaving an mmap behind
parent
14c06cd2d4
commit
4bcefe0562
|
@ -586,12 +586,18 @@ int main(int argc, char *argv[]) {
|
|||
);
|
||||
}
|
||||
monitor->ForceAlarmOn(config.forced_alarm_score, "Forced Web");
|
||||
while ( ((state = monitor->GetState()) != Monitor::ALARM) && !zm_terminate ) {
|
||||
int wait = 10*1000*1000; // 10 seconds
|
||||
while ( ((state = monitor->GetState()) != Monitor::ALARM) and !zm_terminate and wait) {
|
||||
// Wait for monitor to notice.
|
||||
usleep(1000);
|
||||
wait -= 1000;
|
||||
}
|
||||
if ( (state = monitor->GetState()) != Monitor::ALARM and !wait ) {
|
||||
Error("Monitor failed to respond to forced alarm.");
|
||||
} else {
|
||||
printf("Alarmed event id: %" PRIu64 "\n", monitor->GetLastEventId());
|
||||
}
|
||||
}
|
||||
} // end if ZMU_ALARM
|
||||
|
||||
if ( function & ZMU_NOALARM ) {
|
||||
|
|
Loading…
Reference in New Issue