FW: NSClient++ on windows machine
Palle Jensen
palleje at gmail.com
Fri Jun 15 19:10:39 CEST 2007
Thanks Lars... I have done a lot of reading :=) but I still don't get it
right, though I think I am very close.
I made some changes, but for some reason it still doesn't match, where do I
do wrong? Below are my settings, outputs and results.
Is anyone able to see what is wrong?
Service defenition:
# Monitoring Memory Usage
define service {
use generic-service
host_name server01,server02
service_description Memuse
servicegroups load
check_command check_ntmem!MEMUSE! -w 80 -c 90
}
<Snip>
Nagios.log :
[1181921420] Warning: Service performance data command 'echo
'server01\tMemuse\tMemory usage: total:4485.60 Mb - used: 1452.13 Mb (32%) -
free: 3033.47 Mb (68%)\tMemory
usage=1452.13Mb;3588.48;4037.04;0.00;4485.60\n' | nc6 -u -w 3 localhost
5667' for service 'Memuse' on host 'server01' timed out after 5 seconds
[1181921500] Warning: Service performance data command 'echo
'server02\tMemuse\tMemory usage: total:1280.03 Mb - used: 269.23 Mb (21%) -
free: 1010.80 Mb (79%)\tMemory
usage=269.23Mb;1024.02;1152.03;0.00;1280.03\n' | nc6 -u -w 3 localhost 5667'
for service 'Memuse' on host 'server02' timed out after 5 seconds
<Snip>
ngraph.log:
2007-06-15 11:35:14 PIPE: server01 Memuse Memory usage: total:4485.60
Mb - used: 1502.13 Mb (33%) - free: 2983.46 Mb (67%) Memory
usage=1502.13Mb;3588.48;4037.04;0.00;4485.60
2007-06-15 11:35:14 REGEX: 4 blocks for 'Memuse' found.
2007-06-15 11:35:14 REGEX: graph_value=Memory usage
2007-06-15 11:35:14 REGEX: output=perfdata
2007-06-15 11:35:14 REGEX: regex=m/Memory usage=([0-9]+)Mb/i
2007-06-15 11:35:14 REGEX: perfdata=Memory
usage=1502.13Mb;3588.48;4037.04;0.00;4485.60
2007-06-15 11:35:14 REGEX: NO MATCH.
2007-06-15 11:35:14 VALUES: [server01][Memuse]:No matching perfdata values
found...
2007-06-15 11:41:34 PIPE: server02 Memuse Memory usage: total:1280.03
Mb - used: 245.14 Mb (19%) - free: 1034.89 Mb (81%) Memory
usage=245.14Mb;1024.02;1152.03;0.00;1280.03
2007-06-15 11:41:34 REGEX: 4 blocks for 'Memuse' found.
2007-06-15 11:41:34 REGEX: graph_value=Memory usage
2007-06-15 11:41:34 REGEX: output=perfdata
2007-06-15 11:41:34 REGEX: regex=m/Memory usage=([0-9]+)Mb/i
2007-06-15 11:41:34 REGEX: perfdata=Memory
usage=245.14Mb;1024.02;1152.03;0.00;1280.03
2007-06-15 11:41:34 REGEX: NO MATCH.
2007-06-15 11:41:34 VALUES: [server02][Memuse]:No matching perfdata values
found...
<Snip>
check_ntmem.ncfg:
define ngraph {
graph_legend Memory Used
graph_perf_regex Memory usage=([0-9]+)Mb
graph_value Memory usage
hide yes
rrd_color 00a000
rrd_plottype AREA
service_name Memuse
}
define ngraph {
graph_legend Warning
graph_perf_regex Memory usage=[0-9]+Mb;([0-9]+);
graph_value MemWarning
hide yes
rrd_color 00a000
rrd_plottype HRULE
service_name Memuse
}
define ngraph {
graph_legend Critical
graph_perf_regex Memory usage=[0-9]+Mb;[0-9]+;([0-9]+)
graph_value MemCritical
hide yes
rrd_color 00a000
rrd_plottype HRULE
service_name Memuse
}
define ngraph {
graph_legend Total Space
graph_perf_regex ([0-9]+)$
graph_value MemTotal
hide yes
rrd_color 00ff00
rrd_plottype AREA
service_name Memuse
}
define ngraph {
graph_calc MemTotal,Memory usage,-
graph_legend Free Space
graph_value MemFree
hide yes
rrd_color ff0000
rrd_plottype AREA
service_name Memuse
type CDEF
}
define ngraph {
graph_calc Memory usage,100,*,MemTotal,/
graph_legend Used Space
graph_units Percent (%)
graph_value percentused
hide yes
rrd_color 1C2B53
rrd_plottype LINE
service_name Memuse
type CDEF
}
define ngraph {
graph_calc MemWarning,100,*,MemTotal,/
graph_legend Warning
graph_units Percent (%)
graph_value percentwarning
hide yes
rrd_color FF7700
rrd_plottype LINE
service_name Memuse
type CDEF
}
define ngraph {
graph_calc MemCritical,100,*,MemTotal,/
graph_legend Critical
graph_units Percent (%)
graph_value percentcritical
hide yes
rrd_color FF0000
rrd_plottype LINE
service_name Memuse
type CDEF
}
define ngraph {
graph_calc
percentused,UN,0,percentused,percentwarning,GT,percentwarning,percentused,IF
,IF
graph_legend Used Memory
graph_value Regular
hide no
rrd_color AABBFF
rrd_plottype AREA
service_name Memuse
type CDEF
}
define ngraph {
graph_calc
percentused,UN,0,percentused,percentwarning,-,0,LE,0,percentused,percentcrit
ical,GE,100,percentcritical,-,percentused,percentwarning,-,IF,IF,IF
graph_units Percent (%)
graph_upper_limit 100
graph_value Warning
hide no
rrd_color FFDD66
rrd_plottype STACK
service_name Memuse
type CDEF
}
define ngraph {
graph_calc
percentused,UN,0,percentused,percentcritical,-,0,LE,0,percentused,percentcri
tical,-,IF,IF
graph_units Percent (%)
graph_upper_limit 100
graph_value Critical
hide no
rrd_color FF0000
rrd_plottype STACK
service_name Memuse
type CDEF
}
define ngraph {
graph_calc percentused,AVERAGE
graph_legend Average Usage
graph_units Percent (%)
graph_value vdef_swap_average
hide no
rrd_color 66CC33
rrd_plottype LINE1
service_name Memuse
type VDEF
}
define ngraph {
graph_calc percentwarning,AVERAGE
graph_legend Warning
graph_units Percent (%)
graph_value vdef_warning_average
hide no
rrd_color FF7700
rrd_plottype LINE1
service_name Memuse
type VDEF
}
define ngraph {
graph_calc percentcritical,AVERAGE
graph_legend Critical
graph_legend_eol LEFT
graph_units Percent (%)
graph_value vdef_critical_average
hide no
rrd_color FF0000
rrd_plottype LINE1
service_name Memuse
type VDEF
}
define ngraph {
print_eol justify
service_name Memuse
type COMMENT
}
define ngraph {
print_description Latest Usage:
print_format %11.2lf MB
print_function LAST
print_source Memory usage
service_name Memuse
type GPRINT
}
define ngraph {
print_format (%3.2lf %%)
print_function LAST
print_source percentused
service_name Memuse
type GPRINT
}
define ngraph {
print_description Free Space:
print_eol justify
print_format %11.2lf MB
print_function LAST
print_source MemFree
service_name Memuse
type GPRINT
}
define ngraph {
print_description Average Usage:
print_format %11.2lf MB
print_function AVERAGE
print_source Memory usage
service_name Memuse
type GPRINT
}
define ngraph {
print_format (%3.2lf %%)
print_function AVERAGE
print_source percentused
service_name Memuse
type GPRINT
}
define ngraph {
print_description Used Space:
print_eol justify
print_format %11.2lf MB
print_function LAST
print_source Memory usage
service_name Memuse
type GPRINT
}
define ngraph {
print_description Maximum Usage:
print_format %11.2lf MB
print_function MAX
print_source Memory usage
service_name Memuse
type GPRINT
}
define ngraph {
print_format (%3.2lf %%)
print_function MAX
print_source percentused
service_name Memuse
type GPRINT
}
define ngraph {
print_description Total Space:
print_eol justify
print_format %11.2lf MB
print_function LAST
print_source MemTotal
service_name Memuse
type GPRINT
}
#-EOF---
-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Lars
Stavholm
Sent: Friday, June 15, 2007 3:59 AM
To: Palle Jensen
Cc: 'Nagios Users'
Subject: Re: [Nagios-users] FW: NSClient++ on windows machine
Palle Jensen wrote:
> Hej :=)
>
> Thanks Lars, still struggling in between, to get the ngraphs working for
my
> Check_nt services.
>
> I tried what you said and i got the output data, but how to change it in
the
> ngraph definition? That seems to be not all that easy.
>
> For example:
> check_nt -H ip.ad.dre.ss -v USEDDISKSPACE -l c -p 12489 -w 90 -c 95
>
> Will give the output:
> c:\ - total: 3.95 Gb - used: 2.44 Gb (62%) - free 1.51 Gb (38%) | 'c:\
Used
> Space'=2.44Gb;3.55;3.75;0.00;3.95
>
> If I understand it correct it's the code in "graph_perf_regex ([0-9]+)MB"
> that needs to match or read the output perf data from check_nt e.g | 'c:\
> Used Space'=2.44Gb;3.55;3.75;0.00;3.95
>
> define ngraph {
> graph_legend Used Space
> graph_perf_regex ([0-9]+)MB
graph_perf_regex ([0-9]+)Gb would match the above output's first column.
> graph_value MBused
> hide yes
> rrd_color 00a000
> rrd_plottype AREA
> service_name Filesystems
> }
>
>
> Another example is the Check_nt Memory used
> | 'Memory usage'=1367.25Mb;3588.48;4037.04;0.00;4485.60
>
> Compared to output from Check_mem (native plugin)
> | /=2848MB;17278;17268;0;17358 /boot=16MB;18;8;0;98
> /dev/shm=0MB;170;160;0;250
>
> And the Ngraph definition for the native plugin looks like this:
>
> define ngraph {
> graph_legend Memory Used
> graph_perf_regex MemUsed=([0-9]+)%
There's a '%' character in the expected regular expression,
but there's no '%' character in the above output, hence it
doesn't match.
> graph_value MemUsed
> hide yes
> rrd_color 00a000
> rrd_plottype AREA
> service_name Memuse
> }
>
> What do you think, or are there anyone else that knows how to changes this
> so that I can get the perf data to be picked up by ngraph?
I think you might need to read up on regular expression matching:)
/Lars
> -----Original Message-----
> From: Lars Stavholm [mailto:stava at telcotec.se]
> Sent: Wednesday, June 06, 2007 4:23 PM
> To: Palle Jensen
> Cc: 'Nagios Users'
> Subject: Re: [Nagios-users] FW: NSClient++ on windows machine
>
> Palle Jensen wrote:
>> Hi to all,
>
> Hej:)
>
>> I have been trying to find out how you get the graphs for monitored
>> service on Windows/Nsclient++.
>>
>> It is working fine for the locahost (FC9) Memory, load, procs and users.
>> I added a windows machine with NSClient++, I added the service Ping to
>> both localhost and the windows machine, and the graphs are showing up
>> fine. But when I add Memory, procs, load service to the windows machine
>> no graphs shows. How come it works with ping for both localhost and
>> Windows machine? Even though I made sure that the service_description is
>> the same as for the localhost
>>
>> I am about to go insain, please help? I know this belongs under
>> NagiosGrapher mailinglist, and I posted there as well, but I got 0
>> answers there, hoping that someone can help me here.
>
> I'll just assume that you remembered to restart/reload
> both NagiosGrapher and nagios when adding stuff in config.
>
> There might be a difference in the performance data handed
> back by NSClient as compared to the native check plugins.
>
> The check_load, for instance, can be run manually. Now run the
> check_load for the Windows boxes (whatever it's called) and
> compare the output, especially the output to the righ of the '|'
> character, i.e. the performance data delimiter. If they are not
> the same, they wont fit the same graph definition.
>
> Min you, I have no experience with NSClient at all, but still.
>
> Cheers
> /Lars
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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