README.nrpe_check_control 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. NOTES:
  2. ------
  3. The service definition below assumes you have a command called "check_tcp" already setup
  4. in your config files.
  5. The command definition below assumes that the $USER1$ macro is used to define the location
  6. of your Nagios plugins (i.e. "/usr/local/nagios/libexec") and that the nrpe_check_control
  7. service is located in that directory.
  8. SAMPLE CONFIG FILE SNIPPETS:
  9. ----------------------------
  10. define service {
  11. host_name <host name goes here>
  12. description NRPE
  13. ...
  14. event_handler nrpe_check_control
  15. check_command check_tcp!-p 5666
  16. }
  17. define command {
  18. command_name nrpe_check_control
  19. command_line $USER1$/nrpe_check_control $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ "$HOSTNAME$"
  20. }
  21. ORIGINAL EMAIL SNIPPET:
  22. -----------------------
  23. Date sent: Fri, 30 Mar 2001 18:51:48 -0500
  24. From: adam.bowen@<>
  25. Subject: Event Handler
  26. To: [nagios@nagios.org]
  27. I am attaching the source code for an event handler I wrote to
  28. control checks using nrpe. I add the following check to all remote hosts
  29. using nrpe:
  30. <see example above>
  31. I added this line to the commands.cfg file:
  32. <see example above>
  33. When the NRPE service check listed above has 3 failed connection
  34. attempts, it will run the nrpe_check_control which will search the
  35. services file for all services for $HOSTNAME$ that use the check_nrpe.
  36. It will then request that all these services be disabled. When the
  37. NRPE check returns to the OK state, it will request that all services
  38. using check_nrpe be re-enabled. This will prevent unnecessary e-mail
  39. when there is a problem with the NRPE daemon. This does require
  40. that external commands be enabled.
  41. (See attached file: nrpe_check_control.c)
  42. I thought some other [Nagios] users might find this useful.
  43. Adam G. Bowen