Page 1 of 1

how to get the alarm info such ip address etc in the shell

Posted: Tue Nov 22, 2011 8:05 pm
by faust
hi , experts
I want to exec a shell to send a message when a alarm occur. how to get the alarm info such ip address etc in the shell ?
another question , how to monitor a process ? must I install agents or just using snmp?

thx
faust

Re: how to get the alarm info such ip address etc in the sh

Posted: Thu Nov 24, 2011 4:55 pm
by jsmurphy
If I understand you correctly for the first question you want an event handler that runs a shell script when a problem occurs? If you look in your commands.cfg then at the notify-host-by-email or any of those notification commands you will see an example of shell execution... in the Nagios documentation there is a list of all available macros.

And as for process monitoring... single process? All processes? Linux? Windows? More information if you want some help ;)

Re: how to get the alarm info such ip address etc in the sh

Posted: Wed Dec 14, 2011 2:13 am
by faust
thx , I want to send a measasge when a process is down on linux and unix and windows , how to do it ?

Re: how to get the alarm info such ip address etc in the sh

Posted: Wed Dec 14, 2011 6:20 pm
by jsmurphy
For windows I don't know of a plugin that allows you to monitor the processes in the manner I think you want, you can however use the NSClient++ client to check that services on a windows host are operating correctly. See http://nsclient.org/nscp/ for the client and http://nsclient.org/nscp/wiki/CheckProcState or http://nsclient.org/nscp/wiki/CheckServiceState for examples of configuration.

Nagios comes with a check_procs plugin for monitoring *nix you just need to install NRPE and the plugins-package on each host, though unlike check service state for NSClient++ there is no catch all... you will need to define exactly which processes you want monitored. For examples run check_procs with the --help switch.