From 231c379105c1b87033288825da6a07ed5ee1061d Mon Sep 17 00:00:00 2001 From: Yannick Charton Date: Tue, 7 Oct 2014 23:18:43 +0200 Subject: [PATCH] added nagiosxi as grapher solution --- libexec/check_interface_table_v3t.pl.in | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/libexec/check_interface_table_v3t.pl.in b/libexec/check_interface_table_v3t.pl.in index 441ae32..5cdb463 100644 --- a/libexec/check_interface_table_v3t.pl.in +++ b/libexec/check_interface_table_v3t.pl.in @@ -5179,6 +5179,10 @@ sub GenerateInterfaceTableData { $ghOptions{'grapherurl'} . '/?host=' . $ghOptions{'hostdisplay'} . '&service=' . $servicename . '::check_interface_table_port">' . 'Trends'; } + } elsif ($ghOptions{'grapher'} eq "nagiosxi") { + $CellContent .= '' . + 'Trends'; } } # Retrieve detailed interface info via snmp link @@ -5538,7 +5542,7 @@ sub WriteHtmlFile { # Perfdataout # -------------------------------------------------------------------- # Description: write performance data -# Grapher: pnp4nagios, nagiosgrapher, netwaysgrapherv2, ingraph +# Grapher: pnp4nagios, nagiosgrapher, netwaysgrapherv2, ingraph, nagiosxi # Format: # * full : generated performance data include plugin related stats, # interface status, interface load stats, and packet error stats @@ -5548,8 +5552,8 @@ sub WriteHtmlFile { # ------------------------------------------------------------------------ sub Perfdataout { - #------ Pnp4nagios, Netwaysgrapherv2, ingraph ------# - if (( $ghOptions{'grapher'} eq "pnp4nagios" ) || ( $ghOptions{'grapher'} eq "ingraph" )) { + #------ Pnp4nagios, Netwaysgrapherv2, ingraph, nagiosxi ------# + if (( $ghOptions{'grapher'} eq "pnp4nagios" ) || ( $ghOptions{'grapher'} eq "ingraph" ) || ( $ghOptions{'grapher'} eq "nagiosxi" )) { # plugin related stats $gPerfdata .= "Interface_global::check_interface_table_global::". @@ -6537,7 +6541,7 @@ sub print_usage () { macros are enabled in nagios.cfg/icinga.cfg -g, --grapher (optional) Specify the used graphing solution. - Can be pnp4nagios, nagiosgrapher, netwaysgrapherv2, ingraph or graphite. + Can be pnp4nagios, nagiosgrapher, netwaysgrapherv2, ingraph, graphite or nagiosxi. --grapherurl (optional) Graphing system url. Default values are: Ex: /pnp4nagios @@ -6732,7 +6736,7 @@ sub check_options () { 'perfdatathreshold=s', # define which thresholds should be printed in the generated performance data. 'perfdatadir=s', # where to write perfdata files directly for netways nagios grapher v1 'perfdataservicedesc=s', # servicedescription in Nagios/Icinga so that PNP uses the correct name for its files - 'grapher|g=s', # graphing system. Can be pnp4nagios, nagiosgrapher, netwaysgrapherv2, ingraph or graphite + 'grapher|g=s', # graphing system. Can be pnp4nagios, nagiosgrapher, netwaysgrapherv2, ingraph, graphite, nagiosxi 'grapherurl=s', # graphing system url. By default, this is adapted for pnp4nagios standard install: /pnp4nagios #-------- SNMP related ----------# 'host=s', # SNMP host target @@ -7127,15 +7131,17 @@ sub check_options () { #------- performance data -------# if (exists $commandline{grapher}) { - if ($commandline{grapher} =~ /^pnp4nagios$|^nagiosgrapher$|^netwaysgrapherv2$|^ingraph$|^graphite$/i) { + if ($commandline{grapher} =~ /^pnp4nagios$|^nagiosgrapher$|^netwaysgrapherv2$|^ingraph$|^graphite$|^nagiosxi$/i) { $ghOptions{'grapher'} = "$commandline{grapher}"; if ($ghOptions{'grapher'} eq "pnp4nagios") { $ghOptions{'grapherurl'} = "/pnp4nagios"; } elsif ($ghOptions{'grapher'} eq "ingraph") { $ghOptions{'grapherurl'} = "/ingraph"; + } elsif ($ghOptions{'grapher'} eq "nagiosxi") { + $ghOptions{'grapherurl'} = "/nagiosxi/perfgraphs"; } } else { - print "Specified grapher solution \"$commandline{grapher}\" is not valid. Valid graphers are: pnp4nagios, nagiosgrapher, netwaysgrapherv2, ingraph, graphite.\n"; + print "Specified grapher solution \"$commandline{grapher}\" is not valid. Valid graphers are: pnp4nagios, nagiosgrapher, netwaysgrapherv2, ingraph, graphite, nagiosxi.\n"; exit $ERRORS{"UNKNOWN"}; } }