0

hello board this question may be a little clean and green however,

I've been trying to set up Nagios NSCA for passive checks on a local ubuntu box as a prototype.

for those in the know, my nsca listening on 5667 and send_nsca is on the same ubuntu computer (localhost 127.0.0.1) . I've been reading and testing object definitions and service templates however I have been getting config errors when i try to access nagios web after modifications.

I hope to get clearer instructions on how I can create the service (directories/configurations) to process passive checks in Nagio3 for ubuntu.

laycat
  • 5,381
  • 7
  • 31
  • 46

1 Answers1

0

There are a few things to consider, firstly that localhost is defined as a host and secondly that the check actually exists as it would for any other check but with a command that doesn't actually do anything, for example.. I've created a passiveservices.cfg file with services defined as follows:

define service{
    use                     generic-service,service-pnp
    host_name               Server1,Server2
    service_description     Uptime
    active_checks_enabled   1
    passive_checks_enabled  1
    check_command           check_null
    check_freshness         1
    check_period            none
    }

define service{
    use                     generic-service,service-pnp
    host_name               Server1,Server2
    service_description     Drive space
    active_checks_enabled   1
    passive_checks_enabled  1
    check_command           check_null
    check_freshness         1
    check_period            none

Note that the check command is check_null, it's not actually doing anything.. and passive_checks_enabled is 1.

There are two lines within Nagios.cfg which you need to enable:

accept_passive_host_checks accept_passive_service_checks

It's also a good idea to enable the following two lines aswell

check_service_freshness check_host_freshness

If a server doesn't poll in after a set amount of time, it'll trigger a script (I trigger an email within my config)

Lastly, enable the following two lines:

log_external_commands log_passive_checks

They'll help with debugging if this doesn't work. It writes out to /var/log/syslog on Ubuntu (well, it does on mine)..

Will Ryan
  • 661
  • 1
  • 7
  • 17