1

I have a Nagios install and am trying to add check_raid plug in. I have 3 custom cfg files that I added to nagios.cfg called custom-commands.cfg custom-servicegroups.cfg and custom-services.cfg. They live in /usr/local/nagios/etc/objects/ folder. I am not getting any errors but they are not showing up in my web gui so I don't know if they are being performed or not, or their status, etc.

custom-services.cfg looks like:

    # service template
define service {
    use                     generic-service
    name                    raid
    service_description     raid
    register                0

    normal_check_interval   30
    retry_check_interval    5
    notification_interval   3600

    check_command           check_raid
}

custom-servicegroups.cfg looks like:

define servicegroup{
        servicegroup_name CUSTOM
        alias Custom Checks
}

custom commands looks like:

define command {
    command_name    check_raid
    command_line    /usr/lib/nagios/plugins/check_raid $ARG1$
}

I am trying to run the check_raid command on my windows machine in the group windows-servers. I am not getting any errors so I think the config files are good, nagios restarts without any fussing. However the service check_raid is NOT listed on my web interface. Any advice is greatly appreciated. Thanks for your time.

1 Answers1

1

You need to take a look in your nagios.cfg file (located by default at "/usr/local/nagios/etc/nagios.cfg")

At approximately line 30 you will see lines like the following:

cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg

You'll need to add the following lines into your file:

cfg_file=/usr/local/nagios/etc/objects/custom-commands.cfg 
cfg_file=/usr/local/nagios/etc/objects/custom-servicegroups.cfg
cfg_file=/usr/local/nagios/etc/objects/custom-services.cfg

Alternatively, around line 50 (depending on your config) you'll see a commented out line like below:

#cfg_dir=/usr/local/nagios/etc/

Uncomment the line and amend it to:

cfg_dir=/usr/local/nagios/etc/objects/

This will always process all .cfg files within that directory so you won't need to add each file individually.

Will Ryan
  • 661
  • 1
  • 7
  • 17