Nagios Core – Monitoring windows services using NCPA – (SCCM/SQL)

Posted: December 4, 2019 in SCCM

In this example SCCM and SQL services are monitored by NCPA agent.

Open host configuration file /usr/local/nagios/etc/objects/conf.d/hostname.cfg

Add following lines:

define service{
        use                             generic-service
        host_name                       sccm.test.com
        service_description             SMS Agent host
        check_command                   check_ncpa!-t 'API KEY' -P 5693 -M 'services' -q 'service=CcmExec,status=running'
        }


define service{
        use                             generic-service
        host_name                       sccm.test.com
        service_description             SMS EXECUTIVE
        check_command                   check_ncpa!-t 'API KEY' -P 5693 -M 'services' -q 'service=SMS_EXECUTIVE,status=running'
        }

define service{
        use                             generic-service
        host_name                       sccm.test.com
        service_description             SMS NOTIFICATION SERVER
        check_command                   check_ncpa!-t 'API KEY' -P 5693 -M 'services' -q 'service=SMS_NOTIFICATION_SERVER,status=running'
        }


define service{
        use                             generic-service
        host_name                       sccm.test.com
        service_description             SMS SITE COMPONENT MANAGER
        check_command                   check_ncpa!-t 'API KEY' -P 5693 -M 'services' -q 'service=SMS_SITE_COMPONENT_MANAGER,status=running'
        }


define service{
        use                             generic-service
        host_name                       sccm.test.com
        service_description             SMS SITE SQL BACKUP
        check_command                   check_ncpa!-t 'API KEY' -P 5693 -M 'services' -q 'service=SMS_SITE_SQL_BACKUP,status=running'
        }

define service{
        use                             generic-service
        host_name                       sccm.test.com 
        service_description             SMS SITE VSS WRITER
        check_command                   check_ncpa!-t 'API KEY' -P 5693 -M 'services' -q 'service=SMS_SITE_VSS_WRITER,status=running'
        }


define service{
        use                             generic-service
        host_name                       sccm.test.com
        service_description             SQL Server
        check_command                   check_ncpa!-t 'API KEY' -P 5693 -M 'services' -q 'service=MSSQLSERVER,status=running'
        }


define service{
        use                             generic-service
        host_name                       sccm.test.com
        service_description             SQL Server Reporting Services
        check_command                   check_ncpa!-t 'API KEY' -P 5693 -M 'services' -q 'service=SQLServerReportingServices,status=running'
        }

Service name can be found in services.msc snap-in

Restart nagios systemctl restart nagios and new services should appear for host.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s