Page 1 of 1
service notification
Posted: Wed Apr 30, 2014 7:09 am
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.
Re: service notification
Posted: Wed Apr 30, 2014 3:31 pm
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.
Re: service notification
Posted: Fri May 02, 2014 1:13 am
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.
Re: service notification
Posted: Fri May 02, 2014 11:12 am
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.
Re: service notification
Posted: Fri May 02, 2014 11:13 am
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.
Re: service notification
Posted: Mon May 05, 2014 4:15 am
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.
Re: service notification
Posted: Mon May 05, 2014 11:53 am
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