Here's another interesting bit. If I hard code the -f c:\temp\test.txt into the NSC.ini trailing $ARG1$ $ARG2$ it works...Sort of, it returns OK but it returns OK regardless of what I put for the -w and -c options.
The next step I took was to hard code the -w 1 annd -c 3 switches into the INI file and no matter what I typed as the file name it returned that it couldn't fine $ARG1$ So to recap, here is what is in the NSC.ini: check_file_age=cscript.exe scripts\check_file_age.vbs -f $ARG1$ -w 1 -c 3 and here is what I run from command line: ./check_nrpe -H computername -c check_file_age "c:\temp\test.txt" Which returns "Error File $ARG1$ was not found!" The only difference I can create (which I stumbled on by mistake) is if I change the "c:\temp\test.txt" to just "c:\" then it returns to a strange prompt ( > only) until I hit CTRL-C to bug out. I've tried a log file in the root directory in all cases and there was no change. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Greg Fishback Sent: Wednesday, June 23, 2010 9:28 PM To: 'Opsview Users' Subject: Re: [opsview-users] (no subject) Oh, ignore those last two postings. Sorry, I missed the check_file_age statement. Sorry. What I'm getting when done correctly is "$ARG1$ was not found" -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Greg Fishback Sent: Wednesday, June 23, 2010 9:13 PM To: 'Opsview Users' Subject: Re: [opsview-users] (no subject) Seems logical but here is the outcome: Linux returns "I (0.3.5.1 2008-09-24) seem to be doing fine..." instead of WARNING. Not sure where that came from but it still isn't interpreting the variables correctly. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Natxo Asenjo Sent: Wednesday, June 23, 2010 12:10 PM To: Opsview Users Subject: Re: [opsview-users] (no subject) On Wed, Jun 23, 2010 at 6:01 PM, Greg Fishback <[email protected]> wrote: > Yep, kind of what I expected. When I put > check_file_age=cscript.exe scripts\check_file_age.vbs -f > "c:\temp\test.txt" -w 1 -c 3 > in the NCS.ini file and then run ./check_nrpe -H hostname -c check_file_age > from the linux prompt I get the appropriate respons. In this case, > "WARNING". ok, so it is working. Now the other details. > When I replace the NCS.ini entry with > check_file_age=cscript.exe scripts\check_file_age.vbs $ARG1$ > and then run > ./check_nrpe -H computername -c check_file_age -f "c:\temp\test.txt" -w 1 > -c 3 > It returns nothing. Just getting the "\" character involved me using the > extended ascii code and on my keyboard the @ and " (quote) files were > swapped. Obviously the argument string is not arriving correctly at the > client machine. I'm not sure it's related to that. The macros $ARG1$, $ARG2$, etc, are the arguments you pass check_nrpe, so you could try this: in nsc.ini, check_file_age=cscript.exe scripts\check_file_age -f $ARG1$ -w $ARG2$ -c $ARG3$ (then reload the service). In the linux promt: ./check_nrpe -c check_file_age "c:\temp\test.txt" 1 3 It should work (i think, untested, obviously, but ...). > Greg -- natxo _______________________________________________ Opsview-users mailing list [email protected] http://lists.opsview.org/lists/listinfo/opsview-users _______________________________________________ Opsview-users mailing list [email protected] http://lists.opsview.org/lists/listinfo/opsview-users _______________________________________________ Opsview-users mailing list [email protected] http://lists.opsview.org/lists/listinfo/opsview-users _______________________________________________ Opsview-users mailing list [email protected] http://lists.opsview.org/lists/listinfo/opsview-users
