Graph not generate. JMXEval plugin used by nrpe
Graph not generate. JMXEval plugin used by nrpe
Hello,
I have a problem with jmxeval ver.1.2.6. from https://code.google.com/p/jmxeval/wiki/GettingStarted
I used this extension to checking how much memory actually used java. I get some output from windows host, Nagios server stands on CentOS 6.5. but loose part of data which Nagios need for graphs.
For example when I run “check_jmxeval.bat jmxeval_jb.xml” in windows host I get:
JMXEval MemHeap OK - heapMemoryUsedPercent is 30.5 | heapMemoryUsedPercent=30.5;92;95 time=0.0s
But when I run “check_nrpe -H WinHost -c check_jmxeval” from Nagios serwer by nrpe I get:
JMXEval MemHeap OK - heapMemoryUsedPercent is 30.9
…without this „| heapMemoryUsedPercent=30.5;92;95 time=0.0s”
In file nsclient.log I found something like this:
e:d:\source\nscp\trunk\modules\checkexternalscripts\commands.hpp:91: Failed to parse arguments for command 'check_jmxeval', using old split string method: unknown escape sequence: scripts\check_jmxeval.bat scripts\jmxeval_jb.xml
I found some ideas that adding allow arguments=true in [/settings/external scripts] can help with that but when I add this to nsclient.ini it doesn’t change anything with output. Only new info in .log file: ..\..\..\..\trunk\modules\CheckExternalScripts\CheckExternalScripts.cpp:229: Arguments: scripts\jmxeval_jb.xml
Anybody used this extension and have that kind of problem? Or any idea how to find solution because graphs can be realy useful
Regards,
Jan
I have a problem with jmxeval ver.1.2.6. from https://code.google.com/p/jmxeval/wiki/GettingStarted
I used this extension to checking how much memory actually used java. I get some output from windows host, Nagios server stands on CentOS 6.5. but loose part of data which Nagios need for graphs.
For example when I run “check_jmxeval.bat jmxeval_jb.xml” in windows host I get:
JMXEval MemHeap OK - heapMemoryUsedPercent is 30.5 | heapMemoryUsedPercent=30.5;92;95 time=0.0s
But when I run “check_nrpe -H WinHost -c check_jmxeval” from Nagios serwer by nrpe I get:
JMXEval MemHeap OK - heapMemoryUsedPercent is 30.9
…without this „| heapMemoryUsedPercent=30.5;92;95 time=0.0s”
In file nsclient.log I found something like this:
e:d:\source\nscp\trunk\modules\checkexternalscripts\commands.hpp:91: Failed to parse arguments for command 'check_jmxeval', using old split string method: unknown escape sequence: scripts\check_jmxeval.bat scripts\jmxeval_jb.xml
I found some ideas that adding allow arguments=true in [/settings/external scripts] can help with that but when I add this to nsclient.ini it doesn’t change anything with output. Only new info in .log file: ..\..\..\..\trunk\modules\CheckExternalScripts\CheckExternalScripts.cpp:229: Arguments: scripts\jmxeval_jb.xml
Anybody used this extension and have that kind of problem? Or any idea how to find solution because graphs can be realy useful
Regards,
Jan
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Graph not generate. JMXEval plugin used by nrpe
Could you post the nsc.ini\nsclient.ini file? Also could you run the command you are attempting to execute via nrpe, directly from a cmd process, and send us the output? (something like ./check_jmxeval.bat ./jmxeval_jb.xml )
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Graph not generate. JMXEval plugin used by nrpe
nsclient.ini:
JMXEval MemHeap OK - heapMemoryUsedPercent is 30.5 | heapMemoryUsedPercent=30.5;92;95 time=0.0s
Regards,
Jan
Code: Select all
[/modules]
; CheckDisk - CheckDisk can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckDisk = 1
; Event log Checker. - Check for errors and warnings in the event log. This is only supported through NRPE so if you plan to use only NSClient this wont help you at all.
CheckEventLog = 1
; Check External Scripts - A simple wrapper to run external scripts and batch files.
CheckExternalScripts = 1
; Helper function - Various helper function to extend other checks. This is also only supported through NRPE.
CheckHelpers = 1
; Check NSCP - Checkes the state of the agent
CheckNSCP = 1
; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1
; CheckWMI - CheckWMI can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckWMI = 1
; NRPE server - A simple server that listens for incoming NRPE connection and handles them. NRPE is preferred over NSClient as it is more flexible. You can of cource use both NSClient and NRPE.
NRPEServer = 1
; NSCAClient - Passive check support (needs NSCA on nagios server). Avalible crypto are: {0=No Encryption (not safe), 1=XOR, 2=DES, 3=DES-EDE3, 4=CAST-128, 6=XTEA, 8=Blowfish, 9=Twofish, 11=RC2, 14=AES, 15=AES, 16=AES, 20=Serpent, 23=GOST}
NSCAClient = 1
; NSClient server - A simple server that listens for incoming NSClient (check_nt) connection and handles them. Although NRPE is the preferred method NSClient is fully supported and can be used for simplicity or for compatibility.
NSClientServer = 1
; Undocumented section
[/settings/default]
; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = ............
; Section for NRPE (NRPEListener.dll) (check_nrpe) protocol options.
[/settings/NRPE/server]
; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to commands that are executed.
allow arguments = true
; COMMAND ALLOW NASTY META CHARS - This option determines whether or not the we will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments.
allow nasty characters = true
; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges. parent for this key is found under: /settings/default this is marked as advanced in favour of the parent.
#allowed hosts = ..........
; PORT NUMBER - Port to use for NRPE.
port = 5666
.
.
.
[/settings/external scripts]
#allow arguments=true
#allow nasty characters = true
; A list of aliases available. An alias is an internal command that has been "wrapped" (to add arguments). Be careful so you don't create loops (ie check_loop=check_a, check_a=check_loop)
[/settings/external scripts/alias]
; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_jmxeval = scripts\check_jmxeval.bat scripts\jmxeval_jb.xml
runcmd = "scripts\runcmd.bat"
; A list of wrappped scripts (ie. using the template mechanism)
[/settings/external scripts/wrapped scripts]
; A list of templates for wrapped scripts
[/settings/external scripts/wrappings]
If I understood you right I wrote about in previous post. When I run “check_jmxeval.bat jmxeval_jb.xml” directly in cmd on windows host I get:Also could you run the command you are attempting to execute via nrpe, directly from a cmd process, and send us the output? (something like ./check_jmxeval.bat ./jmxeval_jb.xml )
JMXEval MemHeap OK - heapMemoryUsedPercent is 30.5 | heapMemoryUsedPercent=30.5;92;95 time=0.0s
Regards,
Jan
Re: Graph not generate. JMXEval plugin used by nrpe
You might need to modify the command in NRPE to evoke cmd with the /c parameter
http://nsclient.org/nscp/wiki/guides/na ... al_scripts
http://nsclient.org/nscp/wiki/guides/na ... al_scripts
Former Nagios employee
Re: Graph not generate. JMXEval plugin used by nrpe
Ok, I change external script from
to
but I got the same output
Info from nsclient.log:
What is interesting, when I add
to external script and run jmxeval by nrpe. In file log.txt I got right output
The same output I got when I used this with the old version external script (without cmd /c echo)
With info from nsclient.log:
Any idea?
P.S. Change scripts\check_jmxeval.bat to "scripts\\check_jmxeval.bat" is the solution for that: e:d:\source\nscp\trunk\modules\checkexternalscripts\commands.hpp:91: Failed to parse arguments for command 'check_jmxeval', using old split string method: unknown escape sequence: scripts\check_jmxeval.bat scripts\jmxeval_jb.xml
Code: Select all
check_jmxeval = "scripts\\check_jmxeval.bat" "scripts\\jmxeval_jb.xml"
Code: Select all
check_jmxeval = cmd /c echo “scripts\\check_jmxeval.bat" "scripts\\jmxeval_jb.xml" ; exit($lastexitcode) | powershell.exe -command –
Code: Select all
JMXEval MemHeap OK - heapMemoryUsedPercent is 21.24
Code: Select all
..\..\..\..\trunk\modules\CheckExternalScripts\CheckExternalScripts.cpp:229: Arguments: /c echo scripts\check_jmxeval.bat scripts\jmxeval_jb.xml ; exit($lastexitcode) | powershell.exe -command –
Code: Select all
>> C:\log.txt
Code: Select all
JMXEval MemHeap OK - heapMemoryUsedPercent is 18.41 | heapMemoryUsedPercent=18.41;90;95 time=0.0s
With info from nsclient.log:
Code: Select all
..\..\..\..\trunk\modules\CheckExternalScripts\CheckExternalScripts.cpp:229: Arguments: scripts\jmxeval_jb.xml
P.S. Change scripts\check_jmxeval.bat to "scripts\\check_jmxeval.bat" is the solution for that: e:d:\source\nscp\trunk\modules\checkexternalscripts\commands.hpp:91: Failed to parse arguments for command 'check_jmxeval', using old split string method: unknown escape sequence: scripts\check_jmxeval.bat scripts\jmxeval_jb.xml
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Graph not generate. JMXEval plugin used by nrpe
We might actually be going about this the wrong way, you mentioned you changed:
Was that how you originally defined it? the quotes and double slashes may be causing problems try this one:
You may need to explicitly call the .xml file from within the plugin instead of passing it along side, that may be freaking nsclient out a bit. When check_jmxeval is called from the nagios server, what does it output? And what does the NSClient log output? Don't forget to restart nsclient when making these changes. The main problem here is, I think the plugin is working fine with the exception of missing performance data. In your original post, how you had it defined there, should be fine. We might need to target why exactly the perf data is not being wrapped up too... which should not have to do with passing the .xml file.
Code: Select all
check_jmxeval = "scripts\\check_jmxeval.bat" "scripts\\jmxeval_jb.xml"
Code: Select all
check_jmxeval = scripts\check_jmxeval.bat
Re: Graph not generate. JMXEval plugin used by nrpe
Adding quotes and double slashes removes that kind of info from nsclient.log:
I don't see any differences about output data when I use or . Only that quotes and double slashes removes above info from nsclient.log
NSClient log output
I wrote in earlier post:
What is interesting, when I add
to external script like:
and run check_jmxeval by nrpe. In file log.txt I got right output
It's litle complicated
Code: Select all
e:d:\source\nscp\trunk\modules\checkexternalscripts\commands.hpp:91: Failed to parse arguments for command 'check_jmxeval', using old split string method: unknown escape sequence: scripts\check_jmxeval.bat scripts\jmxeval_jb.xml
Code: Select all
check_jmxeval = scripts\check_jmxeval.bat scripts\jmxeval_jb.xml
Code: Select all
check_jmxeval = "scripts\\check_jmxeval.bat" "scripts\\jmxeval_jb.xml"
Ok, any idea how to do it?You may need to explicitly call the .xml file from within the plugin instead of passing it along side, that may be freaking nsclient out a bit.
When I called from nagios server i seeWhen check_jmxeval is called from the nagios server, what does it output? And what does the NSClient log output?
Code: Select all
JMXEval MemHeap OK - heapMemoryUsedPercent is 18.41
Code: Select all
..\..\..\..\trunk\modules\CheckExternalScripts\CheckExternalScripts.cpp:229: Arguments: scripts\jmxeval_jb.xml
Yeah, I remember about itDon't forget to restart nsclient when making these changes.
I wrote in earlier post:
What is interesting, when I add
Code: Select all
>> C:\log.txt
Code: Select all
check_jmxeval = scripts\check_jmxeval.bat scripts\jmxeval_jb.xml >> C:\log.txt
This is maybe some clueJMXEval MemHeap OK - heapMemoryUsedPercent is 18.41 | heapMemoryUsedPercent=18.41;90;95 time=0.0s
It's litle complicated
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Graph not generate. JMXEval plugin used by nrpe
Could you post the check_jmxeval.bat please? I think its easiest to modify that batch file so that it no longer needs the additional xml file as an argument within the nsclient configuration.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Graph not generate. JMXEval plugin used by nrpe
check_jmxeval.bat:
and jmxeval_jb.xml:
Code: Select all
@echo off
@if "%OS%" == "Windows_NT" setlocal
@pushd %~dp0
@set BASE_DIR=%cd%
@popd
set BASE_DIR=%BASE_DIR%\lib\jmxeval-1.2.6
set LIB_DIR=%BASE_DIR%\lib
call C:\jboss-as-7.1.1.Final\bin\jmx_setup.bat
set CLASSPATH=%CLASSPATH%;%BASE_DIR%\jmxeval-1.2.6.jar;%LIB_DIR%\args4j-2.0.16.jar
rem echo %CLASSPATH%
%JAVA_HOME%\bin\java -classpath "%CLASSPATH%" com.adahas.tools.jmxeval.App %*
Code: Select all
<?xml version="1.0"?>
<jmxeval:jmxeval xmlns:jmxeval="http://www.adahas.com/schema/jmxeval-1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
connect to Java process running on 'localhost' having JMX agent exposed on port '9010'
using username 'myUser' and password 'myPassword'
-->
<connection url="service:jmx:remoting-jmx://localhost:xxxx"
username="xxx" password="xxx">
<eval name="MemHeap">
<query var="heapMemoryUsed" objectName="java.lang:type=Memory" compositeAttribute="HeapMemoryUsage" attribute="used" />
<query var="heapMemoryMax" objectName="java.lang:type=Memory" compositeAttribute="HeapMemoryUsage" attribute="max" />
<expr var="heapMemoryUsedPercent" expression="${heapMemoryUsed}/${heapMemoryMax}*100" />
<check useVar="heapMemoryUsedPercent" warning="92" critical="95" message="heapMemoryUsedPercent is ${heapMemoryUsedPercent}">
<perf />
</check>
</eval>
</connection>
</jmxeval:jmxeval>
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Graph not generate. JMXEval plugin used by nrpe
Considering the only place the xml file is placed in that script is at the very end, I think its best if we simply hardcode the path to it. So try these:
Without scripts\
With scripts
Full path - May need to be changed for different OS architecure or nsclient arch
Try those from the command line, find one that works, then change your nsclient config to have:
Without scripts\
Code: Select all
@echo off
@if "%OS%" == "Windows_NT" setlocal
@pushd %~dp0
@set BASE_DIR=%cd%
@popd
set BASE_DIR=%BASE_DIR%\lib\jmxeval-1.2.6
set LIB_DIR=%BASE_DIR%\lib
call C:\jboss-as-7.1.1.Final\bin\jmx_setup.bat
set CLASSPATH=%CLASSPATH%;%BASE_DIR%\jmxeval-1.2.6.jar;%LIB_DIR%\args4j-2.0.16.jar
rem echo %CLASSPATH%
%JAVA_HOME%\bin\java -classpath "%CLASSPATH%" com.adahas.tools.jmxeval.App .\jmxeval_jb.xml
Code: Select all
@echo off
@if "%OS%" == "Windows_NT" setlocal
@pushd %~dp0
@set BASE_DIR=%cd%
@popd
set BASE_DIR=%BASE_DIR%\lib\jmxeval-1.2.6
set LIB_DIR=%BASE_DIR%\lib
call C:\jboss-as-7.1.1.Final\bin\jmx_setup.bat
set CLASSPATH=%CLASSPATH%;%BASE_DIR%\jmxeval-1.2.6.jar;%LIB_DIR%\args4j-2.0.16.jar
rem echo %CLASSPATH%
%JAVA_HOME%\bin\java -classpath "%CLASSPATH%" com.adahas.tools.jmxeval.App scripts\jmxeval_jb.xml
Code: Select all
@echo off
@if "%OS%" == "Windows_NT" setlocal
@pushd %~dp0
@set BASE_DIR=%cd%
@popd
set BASE_DIR=%BASE_DIR%\lib\jmxeval-1.2.6
set LIB_DIR=%BASE_DIR%\lib
call C:\jboss-as-7.1.1.Final\bin\jmx_setup.bat
set CLASSPATH=%CLASSPATH%;%BASE_DIR%\jmxeval-1.2.6.jar;%LIB_DIR%\args4j-2.0.16.jar
rem echo %CLASSPATH%
%JAVA_HOME%\bin\java -classpath "%CLASSPATH%" com.adahas.tools.jmxeval.App "C:\program files\nsclient\scripts\jmxeval_jb.xml"
Code: Select all
check_jmxeval = scripts\check_jmxeval.bat
instead of:
check_jmxeval = scripts\check_jmxeval.bat scripts\jmxeval_jb.xml
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.