mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-03-22 18:33:43 -04:00
Make alarm handler customisable
This commit is contained in:
parent
4142e17840
commit
c459ca0770
2 changed files with 5 additions and 3 deletions
|
|
@ -168,9 +168,9 @@ void
|
|||
timeout_alarm_handler (int signo)
|
||||
{
|
||||
if (signo == SIGALRM) {
|
||||
printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
|
||||
timeout_interval);
|
||||
exit (STATE_CRITICAL);
|
||||
printf (_("%s - Plugin timed out after %d seconds\n"),
|
||||
state_text(timeout_state), timeout_interval);
|
||||
exit (timeout_state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,11 @@ void print_revision (const char *, const char *);
|
|||
/* Handle timeouts */
|
||||
|
||||
#ifdef LOCAL_TIMEOUT_ALARM_HANDLER
|
||||
extern unsigned int timeout_state;
|
||||
extern unsigned int timeout_interval;
|
||||
RETSIGTYPE timeout_alarm_handler (int);
|
||||
#else
|
||||
unsigned int timeout_state = STATE_CRITICAL;
|
||||
unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
|
||||
extern RETSIGTYPE timeout_alarm_handler (int);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue