send alert once in a day evenif the status is "OK"

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
itzforu
Posts: 12
Joined: Mon Nov 10, 2014 2:15 am

send alert once in a day evenif the status is "OK"

Post by itzforu »

Hello Everybody,

I am using nagios to monitor more than 50 linux servers and its working perfectly.

Now I would like to get an email alert from for services on each day morning evenif the status is okay. is it possible to do with nagios?

Thanks in advance
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: send alert once in a day evenif the status is "OK"

Post by abrist »

Just to clarify, are you looking to receive an OK email once a day?
If so, do you want to do so for specific services, or all services?
What is the use case for this?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
itzforu
Posts: 12
Joined: Mon Nov 10, 2014 2:15 am

Re: send alert once in a day evenif the status is "OK"

Post by itzforu »

Thanks for you reply.

yes, i need to receive OK email once a day.

I want to do this for only one service.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: send alert once in a day evenif the status is "OK"

Post by jdalrymple »

There is no simple way to do this - especially if you want it to be done at a set time each day. The best method that comes to mind would be to write a script in your language of choice that parses the status.dat file and polls the information you seek and E-mails you. I've searched the exchange for such a script and don't see one so you may have to write it yourself or aggregate a group of similarly functioning scripts to achieve your goal.
AlexZ0nder
Posts: 2
Joined: Tue Jan 19, 2016 12:18 am

Re: send alert once in a day evenif the status is "OK"

Post by AlexZ0nder »

Hi everyone!
Today I tried to resolve this issue and realized that we have time periods in Nagios and what if you could create new time period for one hour in the morning for every day... and set this time period in your service as this one.
:D
I have created one like this and right now just waiting the result.

P.S. itzforu, please let me know if it will help you. ;)
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: send alert once in a day evenif the status is "OK"

Post by hsmith »

@AlexZ0nder thanks for the information. Let us know how it goes!
Former Nagios Employee.
me.
AlexZ0nder
Posts: 2
Joined: Tue Jan 19, 2016 12:18 am

Re: send alert once in a day evenif the status is "OK"

Post by AlexZ0nder »

Hi there!
So... about my thought... It's alive!!! :D

Here is my config files:

/usr/local/nagios/etc/services/puppet_filed_nodes_prod.cfg

Code: Select all

....
define service {
        host_name                       prod-puppet
        service_description             Puppet failed nodes PROD
        display_name                    Puppet_failed_nodes_PROD
        check_command                   check_puppet_failed!!!!!!!!
        initial_state                   u
        max_check_attempts              5
        check_interval                  1
        retry_interval                  1
        check_period                    24x7
        notification_interval           60
        first_notification_delay        0
        notification_period             Once_a_day_morning
        notification_options            w,c,u,r,f,s,
        notifications_enabled           1
        contact_groups                  PROD
        register                        1
        }
....
/usr/local/nagios/etc/timeperiods.cfg

Code: Select all

....

define timeperiod {
        timeperiod_name                         Once_a_day_morning
        alias                                   Once in a day in the morning
        sunday                                  09:00-09:50
        monday                                  09:00-09:50
        tuesday                                 09:00-09:50
        wednesday                               09:00-09:50
        thursday                                09:00-09:50
        friday                                  09:00-09:50
        saturday                                09:00-09:50
        }

.....
P.S. We use Nagios XI Version : 2012R2.9
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: send alert once in a day evenif the status is "OK"

Post by rkennedy »

Is this working as expected then, or did you have a question about your configuration?
Former Nagios Employee
Locked