Page 1 of 2

Alert Message

Posted: Wed Sep 30, 2015 3:57 am
by ranjitw
Hi ,

Currently when an alert related to CPU load is generated in Nagios its being shown as below :

CPU Load 98% (5 min average) 5 min avg Load = 98%;80;90;0;100

I want to modify the alert to be shown as below :

CPU global use threshold exceeded (at least 92%)

Can anyone please guide me with the process to modify the alert . It would be of great help if the steps to do modification are shared.

Many thanks,

Regards,
Ranjit W

Re: Alert Message

Posted: Wed Sep 30, 2015 2:14 pm
by lmiltchev
It may be possible to modify the plugin and change the output. What is the plugin that you are using to check the CPU load?

Re: Alert Message

Posted: Mon Oct 05, 2015 12:30 am
by ranjitw
Hi lmiltchev,

I am using check_nt and check_nrpe plugins .

Regards,
Ranjit W

Re: Alert Message

Posted: Mon Oct 05, 2015 4:27 pm
by tmcdonald
Where are you getting the "at least 92%" part? I see in your example that the usage is 98% and is set to warn at 80% and go critical at 90%. I do not see how 92% is being calculated, so it will be hard to guess what value to use.

Re: Alert Message

Posted: Tue Oct 06, 2015 1:47 am
by ranjitw
Hi tmcdonald,

The value would remain the same I want to modify the alarm message to be like CPU global use threshold exceeded (at least xx%) instead of
CPU Load xx% (5 min average) 5 min avg Load = 98%;80;90;0;100.

Is there a way to modify this ?

Regards,
Ranjit W

Re: Alert Message

Posted: Tue Oct 06, 2015 2:22 pm
by hsmith
Have you looked on Nagios Exchange for plugins that may better accomplish what you're looking to do here? It's probably easier than modifying an existing plugin. It sounds like you're looking to change the way the function works completely instead of just modifying the output, if I am understanding you correctly.

Re: Alert Message

Posted: Tue Oct 06, 2015 2:29 pm
by eloyd
Orrr....you could write a simple shell script that is your new plugin (maybe call it check_cpu_with_bonus_action), have it call the appropriate "real" plugin, then use awk and/or sed to pull the field(s) you want and rewrite the output to pass it up the chain. Awkward, but brute-force efficient (and faster) than writing your own plugin.

Re: Alert Message

Posted: Tue Oct 06, 2015 5:13 pm
by scottwilkerson
@ranjitw - Do either of these solutions work for you?

Re: Alert Message

Posted: Wed Oct 07, 2015 7:23 am
by ranjitw
Hi ,

Please see the image I want the alarm to be modified can this is done at UI level ?

Regards,
Ranjit W

Re: Alert Message

Posted: Wed Oct 07, 2015 10:15 am
by hsmith
Do you just want the words to be different? I am a little confused by what you're trying to ask for in that screenshot.