Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange truncation issue with nrpe? #35

Closed
rbw opened this issue Jan 20, 2016 · 5 comments
Closed

Strange truncation issue with nrpe? #35

rbw opened this issue Jan 20, 2016 · 5 comments

Comments

@rbw
Copy link

rbw commented Jan 20, 2016

Hello,

Commands like check_procs seems to fail when used through check_nrpe / nrpe when the output parsed by the command executed exceeds some length. That is - we're not talking about the output returned by check_nrpe, nor check_procs for that matter, but the output parsed by the command called by nrpe. (check_procs in this example).

See the following example:
We're first executing check_procs directly without the involvement of nrpe, which succeeds.
Then we're executing check_procs through nrpe, passing the exact same arguments, which fails when the output parsed by the command execeeds a certain length. This is the case even though the output parsed by check_procs isn't returned to nrpe. This "size theory" is based on the fact that check_procs works properly with check_nrpe when the output parsed by check_procs is smaller.

succeeds - check_procs executed directly without the involvement of nrpe

xxx-s971:/usr/local/nagios/libexec # ./check_procs -C java -a fmsmaster_FSC_BCA_TCUA_PMM_PROD_infodba.xml -vv
CMD: /bin/ps axwo 'stat uid pid ppid vsz rss pcpu cgroup:256 comm args'
Matched: uid=5000 vsz=705568 rss=208800 pid=6287 ppid=1 pcpu=0.00 stat=Sl etime= prog=java args=/usr/java/jdk1.7.0_75/jre/bin/java -d64 -server -Xms256M -Xmx256M -Dcom.sun.management.jmxremote -Dfms.config=./fmsmaster_FSC_BCA_TCUA_PMM_PROD_infodba.xml -Dfsc.config=./FSC_BCA_TCUA_PMM_PROD_infodba.xml -classpath jar/fmsservercache.jar:jar/fmsutil.jar:jar/fscjavaclientproxy.jar:third_party/commons-collections/3.0/commons-collections-3.0.jar:third_party/commons-logging/commons-logging-1.0.4/commons-logging.jar:third_party/commons-httpclient/commons-httpclient-3.1/commons-httpclient-3.1.jar:third_party/commons-codec/commons-codec-1.3/commons-codec.jar:third_party/javamail/1.3/mail.jar:third_party/mld/tc9.1.0.20120806/plmJMXmonitor.jar:third_party/mld/tc9.1.0.20120806/log4j-1.2.13.jar:third_party/mld/tc9.1.0.20120806/jmxtools.jar:third_party/mld/tc9.1.0.20120806/jmxri.jar:third_party/mld/tc9.1.0.20120806/logwriter.jar:third_party/OnionNetworks/webraid-2.6.8_01/lib/onion-common.jar:third_party/OnionNetworks/webraid-2.6.8_01/lib/onion-wantransport-tools.jar:third_party/OnionNetworks/webraid-2.6.8_01/lib/onion-webraid.jar:third_party/OnionNetworks/webraid-2.6.8_01/lib/onion-webraidutil-tools.jar:third_party/OnionNetworks/webraid-2.6.8_01/lib/onion-webraidutil.jar:third_party/OnionNetworks/webraid-2.6.8_01/lib/jdom.jar:third_party/jetty/9.2.0/jetty-server-9.2.0.v20140526.jar:third_party/jetty/9.2.0/jetty-util-9.2.0.v20140526.jar:third_party/jetty/9.2.0/jetty-http-9.2.0.v20140526.jar:third_party/jetty/9.2.0/jetty-io-9.2.0.v20140526.jar:third_party/jetty/9.2.0/servlet-api-3.1.jar:third_party/TcSS/2009.1_20120207/jars/teamcenter_sso_common.jar:third_party/TcSS/2009.1_20120207/jars/teamcenter_sso_proxy.jar:third_party/TcSS/2009.1_20120207/jars/teamcenter_sso_webtoolkit.jar:third_party/TcSS/2009.1_20120207/jars/teamcenter_sso_applib.jar -Djava.library.path=./lib -Dsun.net.client.defaultConnectTimeout=90000 -Dsun.net.client.defaultReadTimeout=90000 -Dcom.teamcenter.mld.logging.prefix=FSC_BCA_TCUA_PMM_PROD_infodba com.teamcenter.fms.servercache.FMSServerCache cgroup_hierarchy=(null)
PROCS OK: 1 process with command name 'java', args 'fmsmaster_FSC_BCA_TCUA_PMM_PROD_infodba.xml' | procs=1;;;0;

fails - check_procs executed with nrpe

xxx-s971:/usr/local/nagios/libexec # ./check_nrpe -H 127.0.0.1 -c check_procs -a "-C java -a fmsmaster_FSC_BCA_TCUA_PMM_PROD_infodba.xml -vv"
CMD: /bin/ps axwo 'stat uid pid ppid vsz rss pcpu cgroup:256 comm args'
PROCS OK: 0 processes with command name 'java', args 'fmsmaster_FSC_BCA_TCUA_PMM_PROD_infodba.xml' | procs=0;;;0;

We're only passing $ARG1$ to check_procs in nrpe.cfg.

Thanks!

@box293
Copy link
Contributor

box293 commented Jan 20, 2016

As a test, have you tried creating a [check_procs_test] command with the full command instead of parsing it as an argument?

command[check_procs_test]=/usr/local/nagios/libexec/check_procs -C java -a fmsmaster_FSC_BCA_TCUA_PMM_PROD_infodba.xml

@rbw
Copy link
Author

rbw commented Jan 25, 2016

Just tested. No difference from passing the arguments to -a.

@jfrickson
Copy link
Contributor

The may be the same issue I fixed in the "maint" branch of nagios-plugins
(https://github.com/nagios-plugins/nagios-plugins/tree/maint)
with commit nagios-plugins/nagios-plugins@75852cf

Go into config.h and find #define PS_COMMAND. Change the axwo to axwwo. Run make && make install then see if that fixes the problem.

@rbw
Copy link
Author

rbw commented Feb 8, 2016

I don't think that's the case as running check_procs manually without the involvement of nrpe works fine, but I'll give it a go.

@rbw
Copy link
Author

rbw commented Feb 8, 2016

This particular server was running an old version of nrpe. Upgraded and the problem was gone.
Sorry about that, should have checked the version number before opening this issue.

@rbw rbw closed this as completed Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants