Hi, Palle Jensen schrieb: > Arno, > >> Then post, for example, the output you get for the memory checks, and >> I'll see how a regex should look that matches parts of the output. > > This is the output I get in 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
Ok... I assume that what you want is the amount of used memory. This is uniquely enclosed between 'used: ' and ' Mb' and it's a decimal number. > And this is what ngraph./log shows: > > 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 This line looks for digits between '...usage=' and 'Mb', which is not the format your plugin produces. > 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... Logical result, then. > The first part of check_ntmem.ncfg looks like this (there is more but it is > pretty long): > > define ngraph { > graph_legend Memory Used > graph_perf_regex Memory usage=([0-9]+)Mb Try this line instead: graph_perf_regex used: (\d+\.\d+) Mb I think that should work. And I guess you see how his works, at least basically. Some understanding of regular expressions IS helpful here. > graph_value Memory usage > hide yes > rrd_color 00a000 > rrd_plottype AREA > service_name Memuse > } > >> I use check_nt to monitor windows hosts, and the plugins return stuff like >> CPU Load 23% (5 min average) | '5 min avg Load'=23%;80;90;0;100 >> which is captures by the following ngraph configuration: >> define ngraph{ >> service_name Windows Load >> graph_perf_regex =(\d+)%; >> graph_value load >> graph_units CPU Usage % >> graph_legend avg load >> rrd_plottype AREA >> rrd_color EACC00 >> } > >> The regex gets the digits between "=" and "%", which is stored in the >> rrd file. > > I will definitely try that, thanks. I think it won't fit to your plugin :-( >> I'm still unsure where exactly your problem is... is it understanding >> how to capture numbers from the plugin output? Or is it in setting up >> all the graphical elements you want? > Correct that is right on the spot. Well, the graphs are a little different. Most of the commands are more or less directly passed to rrdtoll, so you'll need to read the man pages for that beast. The command format is a little too cryptic for me to get useful results without lots of trial and error :-) >>>> (Note that this is not meant as an advertisement, but rather as a last >>>> resort solution for Palle!) >>> Are you kidding?? >> No. > > I appreciate the help you are giving, and sharing your experience, and > apologies for misunderstanding. No worries, as the Aussies are said to say :-) Arno > Thanks, > - Palle > > > ------------------------------------------------------------------------- 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@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