Custom Nagios Macros

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
KevinD
Posts: 26
Joined: Thu Mar 29, 2012 10:26 am

Custom Nagios Macros

Post by KevinD »

We appear to be having two problems
First being using subdirectories after $USER1$
The second being creating new nagios user macros.

We are trying to migrate a group of oracle checks for application specific issues, and trying to keep them consolidated in one folder rather than in the libexec.

Attempt 1
Command was defined as:

Code: Select all

$user1$/oracle11/check_oracle_by_jdbc -H $HOSTADDRESS$ -x `XXXXXXXX` -f '$USER1$/sql/$ARG2$.sql' -w $ARG3$ -c $ARG4$ -r $ARG5$ -L $ARG6$
Service was defined with appropriate arguments, all of which appear to resolve properly, and configuration was applied.

Check output is as follows:

Code: Select all

[STDERR][EC 127]/bin/sh: /usr/local/nagios/libexec/check_oracle_by_jdbc: No such file or directory
Notice that oracle11 is not in the path for the check.

Attempt 2
Assuming that we were simply not able to use subdirectories of a check, we tried creating a new USER macro for the oracle11 directory.
We have added the following to resources.cfg on the parent and all children.

Code: Select all

$USER10$=/usr/local/nagios/libexec/oracle11
and have bounced nagios, and dnx for good measure.

the check command has been defined as

Code: Select all

$user10$/check_oracle_by_jdbc -H $HOSTADDRESS$ -x `XXXXXXXX` -f '$USER1$/sql/$ARG2$.sql' -w $ARG3$ -c $ARG4$ -r $ARG5$ -L $ARG6$
Please note using USER10 rather than USER1 as in the first attempt.

The service has been defined with the appropriate arguments, and applied.
If we run it manually on any host (parent or children) all is well.

When the check runs, we just get:

Code: Select all

[STDERR][EC 127]/bin/sh: /usr/local/nagios/libexec/check_oracle_by_jdbc: No such file or directory
Notice that oracle11 is not in the path for the check.

It appears that nagios does not catch the user10 macro we created, and defaults to user1.

I've dug through documentation, but could not find anything specific to creating USERn macros, just utilizing them.
Can someone kick me in the right direction, or explain what I'm doing wrong in these two scenarios?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Custom Nagios Macros

Post by scottwilkerson »

Without seeing the config snapshot I cannot know for sure, but my guess would be that the new command and the command your check is referencing are named 2 different things.

You are on the right track, and everything outlined should work just fine, but you likely are using 2 different command names.

Feel free to open an email ticket submitting your current snapshot and the name of the service running the check and we can take a look.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
KevinD
Posts: 26
Joined: Thu Mar 29, 2012 10:26 am

Re: Custom Nagios Macros

Post by KevinD »

I did go back and verify, they are using the same name, and it does show the $USER10$ in the Command View.
Screen Shot 2012-05-30 at 10.06.07 AM.png
I'll open a ticket.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Custom Nagios Macros

Post by scottwilkerson »

I just had another thought, I'm not sure what plugin you are using, but you might want to make sure the path isn't being hardcoded in the plugin
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked