NSClient custom counter question

Harper Mann hmann at itgroundwork.com
Fri Oct 8 01:42:17 CEST 2004


Try %2.2f%%

Example:
[root at milano root]# cat foo.c
main() {
        printf("foo is %2.2f%%\n:", 37.66);
}

[root at milano root]# make foo
cc     foo.c   -o foo
[root at milano root]# ./foo
foo is 37.66%

You may also need to escape the % in the check_nt statement: \%2.2f\%\%.

Hope that works,

- Harper

Harper Mann
Groundwork Open Source Solutions
510-599-2075 (cell)


-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Jan Scholten
Sent: Thursday, October 07, 2004 4:07 PM
To: Julian Hein; nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] NSClient custom counter question

Sorry for pulling an old topic, but i came to this right now :)

I have a similar problem:

./check_nt -H 192.168.100.54 -p 1248 -v COUNTER -l "\\Paging  
File(_Total)\\% Usage","Paging File Usage is %.2f%%" -w 35 -c 90
Paging File Usage is %.2f%% = 38
                      ^^^^^^^ Ugly


Wortking but i can't get it being wellformated. So what must i do to geht  
this as 37.66% or something like that.

I tried different Versions like "%.2f %%" "% .2f %" "%%.2f %%" "% .2f %%"   
but no luck..
Any hints?

Jan


> Hi,
>
>> I've got my Nagios install set up to check the paging file on several
>> Windows 200 hosts thus:
>>
>> define command {
>>      command_name    check_nt_pagingfile
>>      command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v
>> COUNTER -l "\\Paging File(_Total)\\%Usage","Paging File Usage
>> is %.2f%%"
>> -w $ARG1$ -c $ARG2$
>> }
>>
>> I'm passing 75 and 90 as the warning and critical levels respectively,
>> but every host I'm checking returns the same result - Paging
>> File Usage
>> is 0.00%
>
> I think, you need a blank between "%" and "Usage":
>
> -l "\\Paging File(_Total)\\% Usage","Paging File Usage is %.2f%%"
>
> Julian
>



-- 
Jan Scholten
Research and Development Intern
Iconz.co.nz


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue. 
::: Messages without supporting info will risk being sent to /dev/null




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list