Nagios Check with Array

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
jenglish
Posts: 59
Joined: Sat Jun 09, 2018 3:51 pm
Location: Boyers, PA

Nagios Check with Array

Post by jenglish »

Hello,

I can't seem to find documentation supporting it, but does Nagios allow for arrays for checks? For instance, I have an LDAP account check. We'd like to know if users are locked. But if you are checking 30 users that is a lot of code for something that is repeated.

In the example below:
User taboyer's account is being monitored. I'd like to be able to use a variable or array here and have the user list be plugged in so I'm not repeating the entire service definition 30+ times.

Code: Select all

define service{
        host_name                       boy-adams
        use                             nm-default-service
        service_description             Account lockout check - Tim
        notes                           Tim's AD account taboyer is locked out.
        check_command                   check_ldap_account!P!taboyer
        notes_url                       onenote:///\\boy-elbert\one$\IS-RUNBOOK\General%20IS\Knowledge%20Base.one#Nagios%20Alert%20-%20Linux%20-%20LDAP%20Account%20Check&section-id={E9C18768-B037-4F6F-AC7E-ADD79E20AB49}&page-id={C19FF347-6402-4BC9-8322-F5C4267C1D2A}&end
        }
Thanks,
Jordan
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Check with Array

Post by scottwilkerson »

Unfortunately there is no mechanism to do this.

You can use templates (as you are in your example), but that is all.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
jenglish
Posts: 59
Joined: Sat Jun 09, 2018 3:51 pm
Location: Boyers, PA

Re: Nagios Check with Array

Post by jenglish »

Thanks for the confirmation, Scott.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Check with Array

Post by scottwilkerson »

jenglish wrote:Thanks for the confirmation, Scott.
No problem
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked