Problem with NagiosXI + Windows batch script.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
yaanatech
Posts: 74
Joined: Thu Mar 29, 2012 1:23 pm

Problem with NagiosXI + Windows batch script.

Post by yaanatech »

We are running a batch script that appears to work locally, but Nagios is giving this error;

Code: Select all

e:D:\source\nscp\trunk\include\socket/connection.hpp:140: Failed to send data: The file handle supplied is not valid
I am sure this has come up before, I do not know what it means, neither does the guy who wrote the batch. Any ideas?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NagiosXI + Windows batch script.

Post by scottwilkerson »

Just to verify, are you calling this via NRPE in NSClient++?

Also, would it be possible to zip and post the .bat file?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yaanatech
Posts: 74
Joined: Thu Mar 29, 2012 1:23 pm

Re: Problem with NagiosXI + Windows batch script.

Post by yaanatech »

Here

Code: Select all

@echo off
set basePath="C:\progra~1\NSClient++\scripts\StandAlonePortalHeartbeat"
set errorlevel=
java -Dgroovy.starter.conf=%basePath%/groovy//conf/groovy-starter.conf -Dgroovy.home=/%basePath%/groovy/ -Dheartbeat.props=%basePath%/heartbeat.properties -Dlog4j.configuration=file:%basePath%/log4j.xml -Djava.net.preferIPv4Stack=true -Dfile.encoding=Cp1252 -classpath "%basePath%\bin;%basePath%\groovy\lib\groovy-all-1.7.10.jar;%basePath%\groovy\lib\antlr-2.7.7.jar;%basePath%\groovy\lib\asm-3.2.jar;%basePath%\groovy\lib\asm-tree-3.2.jar;%basePath%\groovy\lib\bsf-2.4.0.jar;%basePath%\groovy\lib\commons-cli-1.2.jar;%basePath%\groovy\lib\ivy-2.2.0.jar;%basePath%\groovy\lib\jline-0.9.94.jar;%basePath%\groovy\lib\servlet-api-2.4.jar;%basePath%\lib\mail.jar;%basePath%\lib\log4j-1.2.16.jar;%basePath%\lib\slf4j-api-1.5.8.jar;%basePath%\lib\slf4j-log4j12-1.5.8.jar;%basePath%\lib\selenium-server-standalone-2.25.0.jar" org.codehaus.groovy.tools.GroovyStarter --classpath %basePath%\lib\log4j-1.2.16.jar;%basePath%\lib\mail.jar;%basePath%\lib\slf4j-api-1.5.8.jar;%basePath%\lib\slf4j-log4j12-1.5.8.jar;%basePath%\src;%basePath%\bin --main groovy.ui.GroovyMain %basePath%\src\net\yaanatech\standaloneheartbeat\RMSHeartbeat.groovy
rem echo %errorlevel%
IF ERRORLEVEL 1 GOTO err
IF ERRORLEVEL 0 GOTO ok

:err
echo CRITICAL: RMS Heartbeat failed
exit /B 1
 
:unknown
echo UNKNOWN: Something went wrong
exit /B 3

:ok
echo OK: RMS Heartbeat successfull
exit /B 0
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Problem with NagiosXI + Windows batch script.

Post by slansing »

Where did you get this batch file from? Is there any direction on it's download page which we can have a look at? Also can you post your nsc.ini/nsclient.ini.


Try this, open up your command prompt on the Windows machine, then invoke the following:

Code: Select all

cd C:\Program Files\NSClient++\

nscp /test
or if you are running version 3.x or earlier of NSClient++ run this:

Code: Select all

nsclient++ /test
after it has loaded the modules attempt to run the batch file from there.

Let us know what kind of error output you get.
Locked