mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-20 21:57:10 -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)
|
timeout_alarm_handler (int signo)
|
||||||
{
|
{
|
||||||
if (signo == SIGALRM) {
|
if (signo == SIGALRM) {
|
||||||
printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
|
printf (_("%s - Plugin timed out after %d seconds\n"),
|
||||||
timeout_interval);
|
state_text(timeout_state), timeout_interval);
|
||||||
exit (STATE_CRITICAL);
|
exit (timeout_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,11 @@ void print_revision (const char *, const char *);
|
||||||
/* Handle timeouts */
|
/* Handle timeouts */
|
||||||
|
|
||||||
#ifdef LOCAL_TIMEOUT_ALARM_HANDLER
|
#ifdef LOCAL_TIMEOUT_ALARM_HANDLER
|
||||||
|
extern unsigned int timeout_state;
|
||||||
extern unsigned int timeout_interval;
|
extern unsigned int timeout_interval;
|
||||||
RETSIGTYPE timeout_alarm_handler (int);
|
RETSIGTYPE timeout_alarm_handler (int);
|
||||||
#else
|
#else
|
||||||
|
unsigned int timeout_state = STATE_CRITICAL;
|
||||||
unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
|
unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
|
||||||
extern RETSIGTYPE timeout_alarm_handler (int);
|
extern RETSIGTYPE timeout_alarm_handler (int);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue