Page 2 of 3

Re: Nagios Notifications not sending

Posted: Sat Mar 31, 2018 6:32 am
by kwhogster
Guys

I now can send email internally and externally via command line using mailx

Setup the command in Nagios with the -r

All looks good.

Problem is I am still not getting notified by either text or email when I get an alarm on Nagios.

I checked the mail queue and I have no new messages queued up. just a couple of old ones during testing still there,

What else can I check? Note I recently setup escalations

Thoughts?

Re: Nagios Notifications not sending

Posted: Sun Apr 01, 2018 3:44 pm
by tacolover101
can you please show us your mailx commands, and also your objects.cache? (/usr/local/nagios/var/objects.cache)

what contact is not receiving notifications properly, and for what host & service?

that should be enough to tack it down.

Re: Nagios Notifications not sending

Posted: Sun Apr 01, 2018 7:05 pm
by kwhogster
This command line works
echo "test text2" | mailx -s testtext -r [email protected] [email protected]

I am now getting email alerts but randomly not all the alerts are sending notifications.

I and not getting and text alerts at all I set up a separate group for them maybe that's the problem?

Code: Select all

define contact{
        contact_name                    support
        alias                           Network Support
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           [email protected]
        }
define contact{
        contact_name                    text305
        alias                           Network Support
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           [email protected]
        }
define contact{
        contact_name                    text551
        alias                           Network Support
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           [email protected]
        }
define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members       nagiosadmin, support, iosapp
        }
define contactgroup{
        contactgroup_name       textit
        alias                   Nagios Admins
        members                 text305, text551
        }
contact group admins works sometimes. group textit does not at all

My escalations config

Code: Select all

define serviceescalation{
        hostgroup_name          windows-servers,windows-servers-vm,linux-servers
        service_description     *
        first_notification      24
        last_notification       48
        notification_interval   360
        contact_groups          admins,textit
        }
define serviceescalation{
        hostgroup_name          Windows-Desktops,windows-desktops-vm
        service_description     *
        first_notification      24
        last_notification       48
        notification_interval   360
        contact_groups          admins,textit
        }
define hostescalation{
        hostgroup_name          windows-servers,windows-servers-vm,linux-servers
        first_notification      5
        last_notification       8
        notification_interval   60
        contact_groups          admins,textit
        }
define hostescalation{
        hostgroup_name          Windows-Desktops,windows-desktops-vm
        first_notification      5
        last_notification       8
        notification_interval   60
        contact_groups          admins,textit
        }
define hostescalation{
        hostgroup_name          nas-storage,network-printers,switches
        first_notification      5
        last_notification       8
        notification_interval   60
        contact_groups          admins,textit
        }
~
I attached my objects.cache file as a txt file hope this helps

On my checks for the computers some have notification_interval set to 0 and others do not have that setting ????

hope this helps

Re: Nagios Notifications not sending

Posted: Mon Apr 02, 2018 8:53 am
by scottwilkerson
text305 is only part of the textit contact group, when I searched your objects.cached, textit is only attached to escalations most of which have a first_notification of 24

This means 24 regular notifications have to go out before this escalation triggers.

For everything where notification_interval = 0 this will never happen, because these will not renotify

Re: Nagios Notifications not sending

Posted: Mon Apr 02, 2018 9:14 am
by kwhogster
Thanks

Should I add contact_groups admins, textit to each of my hosts ?
If I do that I do not need to add contact_groups to all my services correct?

I am not sure why I made the notification_interval = 0 I will change them to the default 60

Thoughts


Update I now remember why I changed the notification_interval to 0 I have a check_Interval = 1440 or 10080 or 1 or 360 etc

How would I setup notification_internavals with values like that?

Re: Nagios Notifications not sending

Posted: Mon Apr 02, 2018 9:32 am
by scottwilkerson
kwhogster wrote:Should I add contact_groups admins, textit to each of my hosts ?
If I do that I do not need to add contact_groups to all my services correct?
that would be correct, except, if you manually add a contact to a service you would also want to add the contact group because it would break the host-> service implied inheritance.
kwhogster wrote: Update I now remember why I changed the notification_interval to 0 I have a check_Interval = 1440 or 10080 or 1 or 360 etc

How would I setup notification_internavals with values like that?
Not sure of your desired affect, but setting notification_interval to 0 disables re-notifications. You would want to set this value to the frequency you want to be re-notified

Re: Nagios Notifications not sending

Posted: Mon Apr 02, 2018 10:02 am
by kwhogster
I get this when I change the notification_interval to the default value of 60

Warning: Service 'NSClient++ Version' on host 'TGKW001' has a notification interval less than its check interval! Notifications are only re-sent after checks are made, so the effective notification interval will be that of the check interval.

define service{
use generic-service
host_name TGKW001
service_description NSClient++ Version
servicegroups nsclients
check_interval 10080
notification_interval 60
check_command check_nt!CLIENTVERSION
}

If I set it to 0 no warnings. I only need to check this once a week as 10080 means.

If I make the value the same as the check_interval 10080 then it does not give a warning either
But what does that mean? Will I only get a notification once a week also?

Has any one set the check_interval to a higher value than the default?

Thanks

Re: Nagios Notifications not sending

Posted: Mon Apr 02, 2018 10:11 am
by scottwilkerson
kwhogster wrote:Warning: Service 'NSClient++ Version' on host 'TGKW001' has a notification interval less than its check interval! Notifications are only re-sent after checks are made, so the effective notification interval will be that of the check interval.
this is just a warning, AKA a reminder, not to expect notifications more frequently than your check interval
kwhogster wrote:If I make the value the same as the check_interval 10080 then it does not give a warning either
But what does that mean?
It will act the same way as if the notification_interval was less than the check_interval UNLESS the notification_interval is set to 0 which is special and disables re-notifications.
kwhogster wrote:Will I only get a notification once a week also?
yes.
kwhogster wrote:Has any one set the check_interval to a higher value than the default?
yes all the time, you just need to know that you will never get a notification more frequently than you are allowing the check to run (check_interval)

Re: Nagios Notifications not sending

Posted: Mon Apr 02, 2018 10:16 am
by kwhogster
Cool

I will go thru all my checks

Will post results

Off to shovel snow now

Re: Nagios Notifications not sending

Posted: Mon Apr 02, 2018 10:47 am
by scottwilkerson
let us know if we can be of further assistance