Assaf Flatto skrev: > Thanks for the help , whoever i did as you recommended and modified my map > file to be as follows : > > # Service type: unix-slapd > # ouput:OK - Established connections: 6 > # perfdata:OK - Established connections: 373 > /prefdata:OK - Established connections: ([0-9]+) / change back to output instead of perfdata. then remove last space before / /output:OK - Established connections: ([0-9]+)/
> and push @s, ['slapd', > [ 'Established connections:', GAUGE, $1 ] ]; > > > > In the nagiosgraph.log > > Wed Feb 25 14:09:22 2009 showgraph.cgi debug - graphinfo(host, SLAPD Open > connections) > Wed Feb 25 14:09:22 2009 showgraph.cgi debug - db = []; > Wed Feb 25 14:09:22 2009 showgraph.cgi debug - getfilename(host, SLAPD Open > connections, ) > Wed Feb 25 14:09:22 2009 showgraph.cgi debug - getfilename dbseparator: > 'subdir' > Wed Feb 25 14:09:22 2009 showgraph.cgi debug - scanning > /usr/local/nagios/nagiosgraph/rrd/host for > SLAPD%20Open%20connections___ > Wed Feb 25 14:09:22 2009 showgraph.cgi debug - dbfilelist = []; > Wed Feb 25 14:09:22 2009 showgraph.cgi info - Listing > host/SLAPD%20Open%20connections___ db files > in /usr/local/nagios/nagiosgraph/rrd: > Wed Feb 25 14:09:22 2009 showgraph.cgi debug - rrd = []; > Wed Feb 25 14:09:22 2009 showgraph.cgi debug - rrdline(host, SLAPD Open > connections, , , 34560000) > Wed Feb 25 14:09:22 2009 showgraph.cgi info - RRDs::graph = [ > '-', > '-a', > 'PNG', > '--start', > '-34560000', > '-w', > 600 > ]; > > Wed Feb 25 14:09:29 2009 insert.pl warn - perfdata not recognized: > date||host||desc||out||data for: > servicedescr:SLAPD Open connections > output:OK - Established connections: 337 > perfdata: > > > > and still no graphs . > > Am i missing something else ? > > Assaf > > > On Wednesday 25 February 2009 13:32:22 Mattias Ryrlén wrote: >> Hi, >> >> First it seems that you have your regexp wrong. >> >> sample script to verify what type of output you get: >> #!/usr/bin/perl >> $_ = "OK - Established connections: 235"; >> s/OK .* ([0-9]+) //g; >> print $_ . "\n"; >> >> print "1 = " . $1 . "\n"; >> >> >> and runing it: >> ./regexp.pl >> OK - Established connections: 235 >> 1 = >> >> OK - Established connections: ([0-9]+) >> >> gives you right result. >> >> Assaf Flatto skrev: >>> Hello List >>> >>> I've been struggling with the nagiosgraph , granted i am not that fluent >>> with perl , but i do have a basic grasp of it . >>> >>> The problem i am having is adding services ( of course) . >>> >>> define service{ >>> use linux-service >>> host_name host >>> service_description SLAPD Open connections >>> check_command check_nrpe_no_ssl!check_slapd >>> icon_image ldap.gif >>> action_url >>> /nagiosgraph/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$ } >>> >>> I have a check in nagios to see the amount of slapd connections to my >>> openldap servers : Command : >>> /usr/lib/nagios/plugins/check_connections -w 800 -c 925 -C slapd >>> >>> sample Result : >>> OK - Established connections: 235 >>> >>> now - trying to parse this in the nagiosgraph map file i have the >>> following definition : >>> >>> # Service type: unix-slapd >>> # ouput:OK - Established connections: 6 >>> /output:OK .* ([0-9]+) / >>> and push @s, ['slapd', >>> [ 'Established connections:', GAUGE, $1 ] ]; >>> >>> In the nagiosgraph log i have the following : >>> Wed Feb 25 11:24:04 2009 showgraph.cgi debug - graphinfo(host, SLAPD Open >>> connections) Wed Feb 25 11:24:04 2009 showgraph.cgi debug - db = []; >>> Wed Feb 25 11:24:04 2009 showgraph.cgi debug - getfilename(host, SLAPD >>> Open connections, ) Wed Feb 25 11:24:04 2009 showgraph.cgi debug - >>> getfilename dbseparator: 'subdir' Wed Feb 25 11:24:04 2009 showgraph.cgi >>> debug - scanning /usr/local/nagios/nagiosgraph/rrd/host for >>> SLAPD%20Open%20connections___ >>> Wed Feb 25 11:24:04 2009 showgraph.cgi debug - dbfilelist = []; >>> Wed Feb 25 11:24:04 2009 showgraph.cgi info - Listing >>> host/SLAPD%20Open%20connections___ db files in >>> /usr/local/nagios/nagiosgraph/rrd: >>> Wed Feb 25 11:24:04 2009 showgraph.cgi debug - rrd = []; >>> Wed Feb 25 11:24:04 2009 showgraph.cgi debug - rrdline(host, SLAPD Open >>> connections, , , 118800) Wed Feb 25 11:24:04 2009 showgraph.cgi info - >>> RRDs::graph = [ >>> '-', >>> '-a', >>> 'PNG', >>> '--start', >>> '-118800', >>> '-w', >>> 600 >>> ]; >>> >>> yet i get no graph . >>> >>> Any ideas where i am doing this wrong ? >>> >>> Thank you > > > -- Vänliga hälsningar / Best Regards Mattias Ryrlén __________________________ op5 AB Första Långgatan 19 SE-413 27 Göteborg Mobil: +46 735-17 70 99 Support: +46 31-774 09 24 www.op5.com ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ 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