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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
faust
Posts: 7
Joined: Tue Oct 11, 2011 3:17 am

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

Post 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
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

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

Post 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 ;)
faust
Posts: 7
Joined: Tue Oct 11, 2011 3:17 am

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

Post by faust »

thx , I want to send a measasge when a process is down on linux and unix and windows , how to do it ?
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

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

Post 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.
Locked