Notification question
Marc Powell
marc at ena.com
Tue Jan 19 18:18:25 CET 2010
On Jan 19, 2010, at 10:15 AM, Steven Battaille wrote:
> If the threshold increases to 91% we don’t get an email anymore because the state doesn’t change. (it’s still warning).
>
> We now want Nagios to send an email that as soon as the threshold value has changed we get an email. (from 90 to 91)
>
> We don’t want to get an email as long as the threshold stays at 90%(we already got this by mail)
>
> Does somebody knows a solution for this?
Nagios doesn't work like this. It does not know or care that it changed from 90 to 91 so it can't do anything with it. This speaks to the core of how nagios sees the world.
<education>
When nagios runs a plugin to check something, it will receive up to 3 things back from the plugin -
- a numeric exit code that corresponds to the current state (OK, WARNING, CRITICAL, UNKNOWN)
- some text comprised of <human readable output>[|<optional performance data>]
Nagios only really cares about the state, everything else is just fluff.
State changes are the only things that trigger notifications*, unless you have 'is_volatile' set. If the plugin returns WARNING for 90 and WARNING for 91, nagios only sees WARNING for both so the state hasn't changed and a new notification isn't necessary. If you set is_volatile, nagios will send a notification every time the state is not OK (90, 91, 90, 90, 90 would all generate notifications.)
The part that you're interested in doing something with is in the <human readable output>. Nagios does nothing with this. It can be any text in any format, depending on what the plugin thinks is useful to you and what you've asked it to check. Since there's no possible way to know and parse an effectively infinite variety of plugin output content and format, nagios does none of it. It just makes it available in the GUI and as a macro for you to do whatever you want to with it on your own. Typically it's just sent to the notification command for inclusion in the notification.
</education>
That being said, what you could do is to add some logic to your notification command for this case. Your notification command can be any script at all. The default is just a simple mail command but it could be something very complex. If you write your own, it would need to do things like keep track of the prior state and only send a notification of your criteria were met.
--
Marc
*outside of re-notifications due to notification_interval or escalations...
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list