jboss2nagios plugin problems

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mhinjos
Posts: 12
Joined: Fri Jan 24, 2014 5:14 am

jboss2nagios plugin problems

Post 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$
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: jboss2nagios plugin problems

Post 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.
Former Nagios employee
Stuart Watts
Posts: 40
Joined: Wed Sep 25, 2013 7:01 am

Re: jboss2nagios plugin problems

Post 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.
mhinjos
Posts: 12
Joined: Fri Jan 24, 2014 5:14 am

Re: jboss2nagios plugin problems

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: jboss2nagios plugin problems

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mhinjos
Posts: 12
Joined: Fri Jan 24, 2014 5:14 am

Re: jboss2nagios plugin problems

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: jboss2nagios plugin problems

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked