## ## nagiostat.conf ## ## Configuration-file for nagiostat, author Carl Bingel / Svensk IT konsult AB 2003(c). Everything ## in this file and any other file included in the nagiostat-package is copyrighted under the ## GNU General Public License (GPL). ## General info: This configuration-file is built-up through the simple syntax of one config-statement per line, ## every statement begins with a parametername followed by one or more parameters. Parameters should be enclosed in quotes when ## containing white-space. Quotation-marks themselves may be escaped with \ (common shell-style). Lines beginning with hash (#) ## are considered comments. Comments are not allowed in the end of statement-lines. ## Since all lines in this files are parsed using the shellwords.pl-package, it is important that ## quote-marks are written in pairs EVEN IN COMMENTS. This is a known bug. # Pointer to where the rrd-tool binary is located RRDToolPath %%PREFIX%%/bin/rrdtool # Pointer to where HTML-templates are stored HTMLTemplatePath %%NAGIOSTATDIR%%/html-templates # Pointer to HTML-template for the index-page (relative to HTMLTemplatePath) GraphIndexTemplate graphindex.html # Pointer to directory where the RRD-archive-files are stored # nagiostat automatically creates RRD-archives if they dont exist. # IMPORTANT: the whole directory RRDArchivePath must be writable by the nagios user (that calls the # nagiostat-script) RRDArchivePath %%NAGIOSTATRRD%%/ ## How many graphs per HTML-page and which time-periods they should represent ## TemplateName Definitions (format=::) GraphTimeTemplate std_1year -2hour:-2min:"Hourly graph" -30hours:-2min:"Daily graph" -9days:-2min:"Weekly graph" -1month:-2min:"Montly graph" -1year:-2min:"Yearly graph" ## Templates to use the first time a RRD-archive is created and initialised. Everything in the 2nd argument (and on) ## are options sent to rrdtool for specifying how the archives should be configured. For more information on ## this, please see the documentation of rrdtool. ## Nagiostat always adds the 'rrdtool create '-part of the command-line. ## ## TEMPLATE-NAME CREATION-PARAMETERS RRDCreateTemplate ping_5min --step 300 DS:rta:GAUGE:600:0:5000 DS:pktloss:GAUGE:600:0:100 RRA:AVERAGE:0.5:1:396 RRA:AVERAGE:0.5:6:336 RRA:AVERAGE:0.5:24:480 RRA:AVERAGE:0.5:234:480 RRDCreateTemplate ping_1min --step 60 DS:rta:GAUGE:120:0:5000 DS:pktloss:GAUGE:120:0:100 RRA:AVERAGE:0.5:1:1800 RRA:AVERAGE:0.5:7:1850 RRA:AVERAGE:0.5:24:1860 RRA:AVERAGE:0.5:290:1820 RRDCreateTemplate stdvalue1_5min --step 300 DS:rta:GAUGE:600:0:5000 DS:value:GAUGE:600:0:100 RRA:AVERAGE:0.5:1:396 RRA:AVERAGE:0.5:6:336 RRA:AVERAGE:0.5:24:480 RRA:AVERAGE:0.5:234:480 RRDCreateTemplate ifrate_1min --step 60 DS:in:GAUGE:120:0:100000 DS:out:GAUGE:120:0:100000 RRA:AVERAGE:0.5:1:1800 RRA:AVERAGE:0.5:7:1850 RRA:AVERAGE:0.5:24:1860 RRA:AVERAGE:0.5:290:1820 ## Templates to use when the cgi-script (nagiostat.cgi, which btw is a symbolic link to nagiostat) calls ## rrdtool to create the graph on the fly. All parameters in the 2nd argument (and on) are options to rrdtool, please ## see the documentation on rrdtool for more information. ## Nagiostat always adds the 'rrdtool graph '-part of the command-line. ## The '$s'-macro contains the starttime-argument from GraphTimeTemplate, should in most cases be used with the --start (-s) switch. ## The '$e'-macro contains the endtime-argument from GraphTimeTemplate, should in most cases be used with the --end switch. ## The '$f'-macro contains the rrd-filename from the Graph-statement. ## The '$d'-macro contains the description-argument from the GraphTimeTemplate-statement. ## ## Template-Name PLOT-PARAMETERS PlotTemplate ping_rta --start $s --end $e DEF:rta=$f:rta:AVERAGE LINE1:rta#00A000:\"Roundtrip average (ms)\" HRULE:100#D0D000:\"Warning level\" HRULE:400#E00000:\"Critical level\" GPRINT:rta:MAX:\"Roundtrip MAX\\: %.4lgms\" GPRINT:rta:MIN:\"Roundtrip MIN\\: %.4lgms\" GPRINT:rta:AVERAGE:\"Roundtrip average\\: %.4lgms\" PlotTemplate ping_pktloss --start $s --end $e DEF:pktloss=$f:pktloss:AVERAGE LINE1:pktloss#00A000:\"Packetloss (%)\" HRULE:20#D0D000:\"Warning level\" HRULE:50#E00000:\"Critical level\" GPRINT:pktloss:MAX:\"Pktloss MAX\\: %.4lg%%\" GPRINT:pktloss:MIN:\"Pktloss MIN\\: %.4lg%%\" GPRINT:pktloss:AVERAGE:\"Pktloss average\\: %.4lg%%\" PlotTemplate ts_sessions --start $s --end $e DEF:value=$f:value:AVERAGE LINE1:value#A00000:\"TS Sessions (#)\" PlotTemplate ifrate --start $s --end $e -X 1 DEF:in=$f:in:AVERAGE DEF:out=$f:out:AVERAGE AREA:in#00D000:\"Inbound traffic (kbit/s)\" LINE1:out#0000A0:\"Outbound traffic (kbit/s)\" ## The performance-data gets sent to nagiostat through a number of command-line-arguments. Every performance-test/reading ## nagios performs gets sent to nagiostat together with information on from which host this performance-reading is collected ## from and which service. Unfortunately, nagios does not send the actual service-name used in the nagios configuration-file, but ## instead sends the service-description. This is important to remember when writing this configuration. ## And everytime performance-data gets sent to it, nagiostat needs to know in which RRD-archive it will store the actual reading. ## This is why you have to specify regular expressions for mathing the hostname and service-description. ## ## ## Templates for using regular expressions to extract numericals from the textual output of the nagios-plugin and ## where to store them. This is really where all the magic happens. ## These may look a little funny, but arent that complicated when explained. ## First argument is the template-name. ## The second (and on) argument tells nagiostat how to parse the text output. ## You can extract an indefinite number of values from each textual message. For example ## the ping-plugin returns both packet-loss and round-trip-time (RTA). ## Example of check_ping output: "PING OK - Packet loss = 0%, RTA = 8.94 ms" ## In the ping-example we want to store both packet-loss and RTA in the archives for graphing, hence ## the two regex-match arguments. ## ## The general format for each parsing is ":://". ## Dont forget the quotation-marks. This is to separate several regex-matches on the same config-line. ## The first parameter is either "output" or "perfdata". This specifies wether to do the mathing on ## either the textual "output" from the plugin (the text that is seen under the column "Status information" in the ## "Service detail"-screen in the nagios web interface) or the "perfdata"-output which is not seen ## in the nagios web interface but sent to nagiostat through the special perfdata-parameter (see nagios documentation). ## Not many checks do output performance-data yet, which is a pity, and thats also the reason for the a little bit cludgy ## alternative to extract the data from the textual-output from the plugin. ## The second parameter specifies which DS-name to put the reading (DS=DataSource, see rrdtool documentation) in, this ## corresponds to the ds-name used in the RRDCreateTemplate (i.e. 'DS:rta:GAUGE:600:0:5000') where the ds-name is 'rta'. ## The third parameter is the regular expression. The regular expression must be enclosed with slashes (/). ## The value to be extracted must be within the first paranthesis-pair. Typicaly you only need one paranthesis-pair. ## When constructing these, it is most useful to setting the $DEBUGLEVEL=3 and watch the debug-output-file. ## The debug-file tells you everything, how the data sent to nagiostat looks like and how the regex-parsing works (or not works). ## ValueRegexTemplate ping_rta_pktloss "output:rta:/RTA = ([0-9.]+) ms/" "output:pktloss:/loss = (\\d+)%/" ValueRegexTemplate generic_int "output:value:/(\\d+)/" ValueRegexTemplate ifrate_in_out "output:in:/\\[IN\\]=(\\d+) kbit/" "output:out:/\\[OUT\\]=(\\d+) kbit/" ## ## INSERTVALUE : [: [..]] ## Inserts performance-data into RRD-Archive. Parses the performance-data OR the regular module-output for the value/values to insert. ## The filename of the rrd-archive, relative to the RRD-archive-path ## Regexp (enclosed in slashes a lá Perl) used to match the hostname ## Regexp (enclosed in slashes) used to match the service-description ## ## RRDArchiveFile RRDCreateTemplate HostRegex ServiceRegex ValueRegexTemplate # Example to record roundtrip and packetloss from a PING test (using check_ping) InsertValue sunet-ping.rrd ping_1min /ftp.sunet.se/ /PING/ ping_rta_pktloss InsertValue purjo-ping.rrd ping_1min /purjo/ /PING/ ping_rta_pktloss InsertValue snake-ping.rrd ping_1min /snake/ /PING/ ping_rta_pktloss # Generic INT-value read through SNMP InsertValue cixten-ts_sessions.rrd stdvalue1_5min /cixten/ /Terminalserver/ generic_int # Interface monitoring, traffic rate using the check_snmp_counter2 plugin for reading delta-values on counters. InsertValue itknsgw1-ifrate.rrd ifrate_1min /itknsgw1/ /if-traffic/ ifrate_in_out InsertValue itknsgw2-ifrate.rrd ifrate_1min /itknsgw2/ /if-traffic/ ifrate_in_out ## These templates are used to assemble a webpage with several graphs over time. ## First argument specifiec the name of the graph-page to use when calling the cgi-script with the cgi-parameter ## graph_name set to that. (Example URL: http://mynagiosserver/nagiostat/nagiostat.cgi?graph_name=purjo-ping) ## Second argument is which rrd-archive to use as datasource ## Third argument is which graph-time-template to use (how many graphs/page and which time-spans) ## Fourth argument is which plot-template to use (arguments to rrdtool what the graphs should look like -- colors and stuff) ## Fifth argument is which HTML-template should be used ## Sixth argument is the title on the web-page generated ## ## GRAPHNAME RRDFILENAME GraphTimeTemplate PlotTemplate HTML-Template Title Graph sunet-ping sunet-ping.rrd std_1year ping_rta default.html "Ping ftp.sunet.se RTA" Graph sunet-ping-pktl sunet-ping.rrd std_1year ping_pktloss default.html "Ping ftp.sunet.se Pktloss" Graph purjo-ping purjo-ping.rrd std_1year ping_rta default.html "Ping purjo.dacom.se RTA" Graph purjo-ping-pktl purjo-ping.rrd std_1year ping_pktloss default.html "Ping purjo.dacom.se Pktloss" Graph snake-ping snake-ping.rrd std_1year ping_rta default.html "Ping snake RTA" Graph snake-ping-pktl snake-ping.rrd std_1year ping_pktloss default.html "Ping snake Pktloss" Graph cixten-ts_sessions cixten-ts_sessions.rrd std_1year ts_sessions default.html "Cixten Aktiva TS-sessioner" Graph itknsgw2-ifrate itknsgw2-ifrate.rrd std_1year ifrate default.html "ITKNSGW2 Interface Traffic Rate"