Nagios Syntax

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
amprantino
Posts: 140
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

Nagios Syntax

Post by amprantino »

Hello all,

Code: Select all

define service{
        use                             generic-service
        host_name                       host1,host2
        service_description             ServiceName
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              2
       normal_check_interval           10080
        retry_check_interval            2
        contact_groups                  admins
        notification_interval           1440
        notification_period             24x7
        notification_options            c,w,r
        check_command                   check_command!snmp
}
Are there any abbreviation for 1440 or 10080 ? For example 1w (1440) or 7d (10080)?

2) When I verify the config:

Warning: Service 'ServiceName' on host 'host1' has a notification interval less than its check interval! Notifications are only re-sent after checks are made, so the effective interval will be that of the check interval.
On the above example, I would like the check to be executed every one week. If an error is detected then the notification should be send every 1440 minutes *=1 day)
Is the above behavior achieved with this configuration?

Is it possible to disable this warning when verifying the config ?

3)
"," at the end of lines is not handled as error. For example:

Code: Select all

define service{
        use                             generic-service
        host_name                       host1,host2,
Is this the expected behavior?

Thank you
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Syntax

Post by rkennedy »

1. No, you'll want to use minutes. This time is relative to the 60 set in your nagios.cfg.

2. You could set a retry_interval to help counter this, otherwise what it is stating is spot on. No, it's not possible to disable the warning.

3. This is expected, commas are used as delimiters.
Former Nagios Employee
amprantino
Posts: 140
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

Re: Nagios Syntax

Post by amprantino »

Code: Select all

define host {
        host_name                       GROUP1

}
define hostgroup{
        hostgroup_name  GROUP1
        members         host1,host2,host3,GROUP1
}

define hostgroup{
        hostgroup_name  NEW_GROUP
        members         host6,host7
        hostgroup_members       GROUP1
}
NEW_GROUP members aren't updated when I have added host "GROUP1" to hostgroup GROUP1
( hostgroup and host name are the same)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Syntax

Post by rkennedy »

Are you applying configuration? I don't think your GROUP1 host will register as a host properly with no template or anything else assigned - does it have a template assigned that you are not showing us?

I just verified all functionality is working with this as you'd expect -

Code: Select all

define hostgroup {
        hostgroup_name                          inheritedhg
        alias                                   this hostgroup is inherited.
        members                                 192.168.1.1,192.168.4.11,192.168.4.15
        }

define hostgroup {
        hostgroup_name                          topgroup
        alias                                   this hostgroup is the top
        members                                 localhost,veeam.nagios.local
        hostgroup_members                       inheritedhg
        }
Anything I add to inheritedhg gets picked up by topgroup.
Former Nagios Employee
Locked