README.nrpe_check_control 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. ------- Forwarded message follows -------
  2. Date sent: Fri, 30 Mar 2001 18:51:48 -0500
  3. From: adam.bowen@<>
  4. Subject: Event Handler
  5. To: [nagios@nagios.org]
  6. I am attaching the source code for an event handler I wrote to
  7. control checks using nrpe. I add the following check to all remote hosts
  8. using nrpe:
  9. service[<host Hame>]=NRPE;0;24x7;3;5;1;<contactgroup>;120;24x7;1;1;0;nrpe_check_control;check_tcp!-p 5666
  10. I added this line to the commands.cfg file:
  11. command[nrpe_check_control]=$USER2$/nrpe_check_control $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$ "$HOSTNAME$"
  12. When the NRPE service check listed above has 3 failed connection
  13. attempts, it will run the nrpe_check_control which will search the
  14. services file for all services for $HOSTNAME$ that use the check_nrpe.
  15. It will then request that all these services be disabled. When the
  16. NRPE check returns to the OK state, it will request that all services
  17. using check_nrpe be re-enabled. This will prevent unnecessary e-mail
  18. when there is a problem with the NRPE daemon. This does require
  19. that external commands be enabled.
  20. (See attached file: nrpe_check_control.c)
  21. I thought some other [Nagios] users might find this useful.
  22. Adam G. Bowen