Page 1 of 1

Centralize Command Definitions?

Posted: Thu Oct 04, 2012 10:23 am
by Virgnarus
Hi,

Getting acquainted with Nagios. Have NagiosQL and NRPE installed. Everything works fine, except one condition that has been a bit irritating. If I needed to change what constitutes a 'warning' or 'critical' state for a check on a remote system, I would have to remote into that system and change the command definition in nrpe.cfg. An example being check_mem with -w 25 -c 15 arguments so it'll warn at 25% free mem usage and 15% usage, respectively. Obviously this can get rather tedious.

So, is there a way to change this behavior to become more centralized through the Nagios server so I can change it through something like NagiosQL, that way I don't have to remote into every system I want to change commands on and just have the Nagios server react differently to the information it receives? Such as the command just sending the data through NRPE to Nagios server and the Nagios server just takes that and determines the appropriate state? Thanks a mil.

Re: Centralize Command Definitions?

Posted: Thu Oct 04, 2012 10:58 am
by yancy
Virgnarus,

You can define warning and critical levels when using check_nrpe, for example:

OK CPU Load ok.|'5m'=0%;80;90 '1m'=0%;80;90 '30s'=0%;80;90

Code: Select all

./check_nrpe -H 192.168.5.166 -c checkCPU -a warn=80 crit=90 time=5m time=1m time=30s
You can also create a hostgroup and use object inheritance so you can define arguments only once on the Nagios side:
http://nagios.sourceforge.net/docs/3_0/ ... tance.html

Regards,

-Yancy

Re: Centralize Command Definitions?

Posted: Thu Oct 04, 2012 11:26 am
by Virgnarus
Doh, I should've known! Thanks!

Re: Centralize Command Definitions?

Posted: Thu Oct 04, 2012 12:05 pm
by yancy
Virgnarus,

No problem, Glad I could help.

Regards,

-Yancy