Think you need a -a before your arguments

check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_file_age -a "c:\temp\test.txt"

shoudl do the trick

Matt White | Escalation Engineer

Wavex Technology Limited
10 Livonia Street
London
W1F 8AF
T  +44 (0) 845 226 8182
F  +44 (0) 845 838 6870

E [email protected]
W http://www.wavex.co.uk

Support | Training | Advice | Security | Disaster Recovery | Monitoring | 
Business Intelligence | On-line Backup | Telephony | Hosting | Virtualisation | 
Remote Working

This email and its attachments may be confidential and are intended solely for 
the use of the individual to whom it is addressed. Unless otherwise indicated, 
any views or opinions expressed are solely those of the author and do not 
necessarily represent those of Wavex Technology Limited. If you are not the 
intended recipient of this email and its attachments, you must take no action 
based upon them, nor must you copy or show them to anyone. The use of this 
information or any disclosure, copying or distribution is prohibited and may be 
unlawful. No confidentiality or privilege is waived or lost by any mistaken 
transmission. If you believe you have received this email in error then please 
contact the sender and delete this email and its attachments. Wavex recommends 
that all emails received by this recipient are scanned appropriately for 
viruses. Wavex Technology Limited is registered in England & Wales with the 
registered number 4258498. The Company's principal place of business, and 
registered office, is 10 Livonia Street, London, W1F 8AF.

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Greg Fishback
Sent: 24 June 2010 05:56
To: 'Opsview Users'
Subject: Re: [opsview-users] (no subject)

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
_______________________________________________
Opsview-users mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-users

Reply via email to