Page 1 of 1

jboss2nagios plugin problems

Posted: Tue Jun 10, 2014 5:55 am
by mhinjos
http://support.nagios.com/forum/viewtopic.php?t=4857

I have the same issue.

[root@nagiosrl01 libexec]# /usr/local/nagios/libexec/check_mbean_collector -H pomona01 -p 5566 -m java.lang:type=Memory -a HeapMemoryUsage -w 60 -c 80
HEAPMEMORYUSAGE OK - HeapMemoryUsage is commited : 1433 MB init : 1536 MB max : 1433 MB used : 316 MB percentage : 22 % OK [root@nagiosrl01 libexec]#
[root@nagiosrl01 libexec]#

but Nagios status information says NULL

My command definition is:

$USER1$/check_mbean_collector.pl -H $HOSTADDRESS$ -p $ARG1$ -m $ARG2$ -a $ARG3$ -w $ARG4$ -c $ARG5$

Re: jboss2nagios plugin problems

Posted: Tue Jun 10, 2014 4:43 pm
by tmcdonald
Try wrapping double quotes around your $ARGX$ values, I know that sometimes causes the null. Though it might also need to be changed in the plugin output itself.

Re: jboss2nagios plugin problems

Posted: Thu Jun 12, 2014 8:11 am
by Stuart Watts
Seconding what tmcdonald said, but also adding my $0.02!

Make sure you become "nagios" before testing plugins on the commandline:

Code: Select all

[root@nagiosrl01 libexec]# su - nagios
[nagios@nagiosrl01 libexec]# /usr/local/nagios/libexec/check_mbean_collector -H pomona01 -p 5566 -m java.lang:type=Memory -a HeapMemoryUsage -w 60 -c 80
This might yield some exciting Perl errors.

Re: jboss2nagios plugin problems

Posted: Tue Jun 17, 2014 8:52 am
by mhinjos
I get the same result


[root@nagiosrl01 libexec]# ./check_mbean_collector -H pomona01 -p 5566 -m java.lang:type=Memory -a HeapMemoryUsage -w 60 -c 80
HEAPMEMORYUSAGE OK - HeapMemoryUsage is commited : 1472 MB init : 1536 MB max : 1472 MB used : 349 MB percentage : 23 % OK [root@nagiosrl01 libexec]# su - nagios

[nagios@nagiosrl01 ~]$ cd /usr/local/nagios/libexec
[nagios@nagiosrl01 libexec]$ ./check_mbean_collector -H pomona01 -p 5566 -m java.lang:type=Memory -a HeapMemoryUsage -w 60 -c 80
HEAPMEMORYUSAGE OK - HeapMemoryUsage is commited : 1472 MB init : 1536 MB max : 1472 MB used : 351 MB percentage : 23 % OK [nagios@nagiosrl01 libexec]$

If you look at the end of the command adds the promp. I tried to put the output in a file and then paint on screen, but does not work, should be something of execution

Re: jboss2nagios plugin problems

Posted: Tue Jun 17, 2014 4:26 pm
by Box293
mhinjos wrote:If you look at the end of the command adds the promp.
In know what you are saying but this should not affect Nagios. However if you wanted to change this to confirm it for yourself, I have looked at the code and you would need to change the following (this is script Revision: 1.2):

Line 120, 124, 128
print $1 . "\n";

Line 131
print $answer . "\n";

tmcdonald wrote:Try wrapping double quotes around your $ARGX$ values, I know that sometimes causes the null. Though it might also need to be changed in the plugin output itself.
Change your command to this:

Code: Select all

$USER1$/check_mbean_collector.pl -H $HOSTADDRESS$ -p $ARG1$ -m \"$ARG2$\" -a \"$ARG3$\" -w \"$ARG4$\" -c \"$ARG5$\"
It may help.

Re: jboss2nagios plugin problems

Posted: Wed Jun 18, 2014 4:08 am
by mhinjos
applying the two changes that suggest

Nagios

COMMAND: /usr/local/nagios/libexec/check_mbean_collector -H pomoa01 -p 5566 -m \"jboss.system:type=Memory\" -a \"HeapMemoryUsage\" -w \"60\" -c \"80\"
OUTPUT:

Line command

[root@nagiosrl01 libexec]# /usr/local/nagios/libexec/check_mbean_collector -H pomona01 -p 5566 -m \"java.lang:type=Memory\" -a \"HeapMemoryUsage\" -w \"60\" -c \"80\"
UNKNOWN ? UNKNOWN - MBeanServer responded: MalformedObjectNameException Invalid character '"' in value part of property

Re: jboss2nagios plugin problems

Posted: Wed Jun 18, 2014 4:16 pm
by Box293
When we wrapped the $ARG$ values with \" they only apply to the command definition. Trying to use them at the command line will not work.
Box293 wrote:In know what you are saying but this should not affect Nagios. However if you wanted to change this to confirm it for yourself, I have looked at the code and you would need to change the following (this is script Revision: 1.2):

Line 120, 124, 128
print $1 . "\n";

Line 131
print $answer . "\n";
When you run the command after making these changes, what is the output?

Code: Select all

[root@nagiosrl01 libexec]# ./check_mbean_collector -H pomona01 -p 5566 -m java.lang:type=Memory -a HeapMemoryUsage -w 60 -c 80