passing arguments with the host_name directive in Core

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lyle
Posts: 158
Joined: Sun Nov 21, 2010 3:05 am

passing arguments with the host_name directive in Core

Post by lyle »

Our old Core installation has one peculiarity I've never figured out.

In a typical Host Definition, the host_name directive looks like this:

Code: Select all

host_name  router-001; key 118981
The key number 118981is a unique ID that is kept in our Metrix inventory, tied to the device router-001.
When there's a Nagios alert, the notification command_line runs a Perl script (passing several Nagios macros) to open a Metrix trouble ticket.

Core documentation says under Object Definitions: "Characters that appear after a semicolon in configuration lines are treated as comments and are not processed".
Yet in a check_command directive, the semicolon clearly separates the command from the arguments to be passed. That's my first question; those two things seem to contradict.

Second question: is the key number 118981 from the host_name directive somehow being passed in the same way as command arguments from the check_command directive are? I can't find any place in the documentation where it mentions this.

I've put Nagios into debug mode to show the processed notification command, and the inventory ID (118981) is nowhere to be found in the call to the Perl script. But if I don't include the 118981 in the host_name directive, no Metrix ticket gets generated, and /var/adm/messages says that the host is "unknown to Metrix".

I certainly don't expect any help on the Metrix XML gateway, but my third question is: how the heck could the 118981 be being passed if not in the notification command?

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

Re: passing arguments with the host_name directive in Core

Post by scottwilkerson »

lyle wrote:Core documentation says under Object Definitions: "Characters that appear after a semicolon in configuration lines are treated as comments and are not processed".
Yet in a check_command directive, the semicolon clearly separates the command from the arguments to be passed. That's my first question; those two things seem to contradict.
Incorrect, it is the exclamation point ! that separates the command from the args.
lyle wrote:Second question: is the key number 118981 from the host_name directive somehow being passed in the same way as command arguments from the check_command directive are? I can't find any place in the documentation where it mentions this.
I would have to see the full command that is used along with the perl script to have a chance at deciphering what it is doing
lyle wrote:but my third question is: how the heck could the 118981 be being passed if not in the notification command?
Same answer as question 2...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked