service notification

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
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

service notification

Post by lafargeuser »

I want to know that in Nagios Core service notification options are w,u,c,r,f,s. Now, suppose if I have to montiror one application & services associates with that application, e.g. I should get notification hourly that all services are in OK States because that will reduced my hourly efforts sending health checks & service check to respecitve owner.

Is this possbile. How can I send hourly status notfication of services to concern person using Nagios.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: service notification

Post by tmcdonald »

host_notification_options:

This directive is used to define the host states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: d = notify on DOWN host states, u = notify on UNREACHABLE host states, r = notify on host recoveries (UP states), f = notify when the host starts and stops flapping, and s = send notifications when host or service scheduled downtime starts and ends. If you specify n (none) as an option, the contact will not receive any type of host notifications.


service_notification_options:

This directive is used to define the service states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: w = notify on WARNING service states, u = notify on UNKNOWN service states, c = notify on CRITICAL service states, r = notify on service recoveries (OK states), and f = notify when the service starts and stops flapping. If you specify n (none) as an option, the contact will not receive any type of service notifications.
That explains the various notification options. As to your second question, are you asking how to send an email every hour regardless of the host or service status? Normally you can assume the host or service is okay until you get a message saying otherwise.
Former Nagios employee
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: service notification

Post by lafargeuser »

Yes. I want to send an Email every hour of the host or service status. How do I do that.
In other way, I want Nagios should send an Email alert for every hour whatever may be service state UP/Down.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: service notification

Post by tmcdonald »

This is not possible. You would be getting a separate email for every host and service, which can quickly reach into the thousands. In Nagios XI Enterprise Edition there are scheduled PDF reports you can make, but this is not available in Core.
Former Nagios employee
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: service notification

Post by sreinhardt »

There is no way with default nagios settings to do this. You would be able to create a script or event handler to check the states of each service and send an email, but there is no built in logic to continually email if there is not an issue.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: service notification

Post by lafargeuser »

In other way, how can I check if a particular service is running in a Windows remote computer using Powershell Script.
How can I call Powershell script from Nagios to check if they are running & send output to an email.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: service notification

Post by lmiltchev »

You can use nagios with NSClient++. Place your script in the NSClient++ scripts directory, define your command in the "NSC.ini" (or "nsclient.ini") file, and use "check_nrpe" from the nagios server to run the command. For example, your command may look something like this:

Code: Select all

my_script=cmd /c echo scripts\my_script.ps1 $ARG1$; exit($lastexitcode) | powershell.exe -command -
and you can call it from nagios by running:

Code: Select all

./check_nrpe -H <client ip> -c my_script
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked