Configure Nagios to receive host information via NSCA

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.
nerdgz
Posts: 28
Joined: Mon Feb 10, 2014 10:21 am

Configure Nagios to receive host information via NSCA

Post by nerdgz »

Hello Everyone,

i receive data from NSCA to Nagios and i want somehow to make it visible in the Nagios web interface.

there is an SAP system that sends data via NSCA but I do not know how to add this configuration in Nagios to read this data...

Someone has some experience about it?


Regards,
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Configure Nagios to receive host information via NSCA

Post by jdalrymple »

The NSCA daemon should just be submitting passive results to the nagios daemon. You only need to have your hosts/services configured (they won't automatically be created) and then they'll be in the UI and the results will be updated.
nerdgz
Posts: 28
Joined: Mon Feb 10, 2014 10:21 am

Re: Configure Nagios to receive host information via NSCA

Post by nerdgz »

Hello Everyone,

I can receive now via NSCA the data from the SAP systems (SAP Solution Manager) and it is visible only on the Nagios Sub Server... but not on the Nagios Master...

SAP system sends via Nsca infomation data to Nagios- sub server and this sub server should also send this data to NAgios Master via NSCA. I m not sure it this is possible at all...

To make it clear why ( on Nagios Master is where i have the Nagios Web interface)

As i can see i have a nbtest server that is configured on Nagios sub server (via active checks) so the Nagios Sub server sends the status information to Nagios Master via NSCA.

Service config for passive checks:
define service{
name generic-sap-service
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
;action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
notes_url /dokuwiki/nagios.php?host=$HOSTNAME$&srv=$SERVICEDESC$
#notes_url /nagiosbp/cgi-bin/whereUsed.cgi?host=$HOSTNAME$&service=$SERVICEDESC$
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_interval 0 ; Only send notifications on status change by default.
# is_volatile 0
check_period 24x7
check_interval 5
retry_interval 5
max_check_attempts 3
active_checks_enabled 0
parallelize_check 1
is_volatile 1
obsess_over_service 0
check_command return-stale ; Report staleness
check_freshness 1 ; Check service 'freshness'
freshness_threshold 4800 ; How fresh must the check be?
passive_checks_enabled 1
notification_period 24x7
notification_options w,u,c,r,f,s
contact_groups admins
register 0
}

for Active services;
# generic service template definition

define service{
name generic-service
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
;action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
notes_url /dokuwiki/nagios.php?host=$HOSTNAME$&srv=$SERVICEDESC$
#notes_url /nagiosbp/cgi-bin/whereUsed.cgi?host=$HOSTNAME$&service=$SERVICEDESC$
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_interval 0 ; Only send notifications on status change by default.
is_volatile 0
check_period 24x7
check_interval 5
retry_interval 5
max_check_attempts 3
notification_period 24x7
notification_options w,u,c,r,f,s
contact_groups admins
register 0
}

Probably the error is on NSCA...

Thanks in advance for your help!

Cheers
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Configure Nagios to receive host information via NSCA

Post by scottwilkerson »

You will need to create an actual service definition for each service_description that NSCA is referencing, so Nagios know about the services before the results arrive
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
nerdgz
Posts: 28
Joined: Mon Feb 10, 2014 10:21 am

Re: Configure Nagios to receive host information via NSCA

Post by nerdgz »

Hello ScottWilkerson,

If I undrestood correct what you mean, I already did it .

So I always add the configuration (service_description) to Nagios Master and via script I sync it to the Nagios Sub server i wanted and via NSCA the Nagios Sub server send status data to Nagios Master.

Code: Select all

define host{
    use                  test-host-sap-solution
    host_name            FP0
    notes                Test
    alias                Test
    hostgroups           all-hosts-sap
    }

define service{
    use                  test-service-sap-solution
    host_name            FP0
    service_description  ACTIVE_SESSION_WAITS
    check_command        check_dummy
    notifications_enable 1
    action_url           /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
    }

define service{
    use                  test-service-sap-solution
    host_name            FP0
    service_description  ORACLE_BACKUP
    check_command        check_dummy
    notifications_enable 1
    action_url           /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
    }

define service{
    use                  test-service-sap-solution
    host_name            FP0
    service_description  ORACLE_BUFFERS
    check_command        check_dummy
    notifications_enable 1
    action_url           /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
    }
This configuration is already on Nagios Master and Nagios sub Server.. this is using the passive checks...that why i not sure if with passive checks will work..

Configured in the same way, i have a server that is using active checks and i can see that every 5 minutes is sync on Nagios Master...
To have a better understanding this is my template for the passive check... (linked to the second post of generic-sap-host and generic-sap-service)

Code: Select all

# template definitions

define host{
        use                             generic-sap-host
        name                            test-host-sap-solution
        contact_groups                 +sap-solution_admins
        notification_period            24x7
        register                        0
        }

define service{
        use                             generic-sap-service
        name                            test-service-sap-solution
        contact_groups                 +sap-solution_admins  
        notification_period            24x7
        register                        0
        }
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Configure Nagios to receive host information via NSCA

Post by jdalrymple »

It's not at all clear how the data is passively getting from the sub server to the master server. Is there an ocsp command at play? If so that should send the data along whether passive or active.
nerdgz
Posts: 28
Joined: Mon Feb 10, 2014 10:21 am

Re: Configure Nagios to receive host information via NSCA

Post by nerdgz »

Hi,

Yes, i am using the ocsp command and it is working fine for the active checks... but the passive it is not working as expected..

If NSCA will not work at all it will make sense but only passive.. i dont know where to look...
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Configure Nagios to receive host information via NSCA

Post by jdalrymple »

This will sound silly, but have you verified that your passive results are coming into the sub-server? It's quite easy to overlook that.
nerdgz
Posts: 28
Joined: Mon Feb 10, 2014 10:21 am

Re: Configure Nagios to receive host information via NSCA

Post by nerdgz »

Hi,

Sorry for this late reply, I had some vaction time :)

I see that the sub- server is working becuase I see it on the web interface of the sub- server ( so everything is displayed)
at the time this configuration needs to go the the Nagios Master, somehow get stuck.. :(
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Configure Nagios to receive host information via NSCA

Post by tgriep »

Take a look at this document and see if it helps out.
http://nagios.sourceforge.net/download/ ... _Setup.pdf
You may need to have passive_checks_enabled for your service checks.
And the names of the checks have to match between the systems for it to work.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked