From b68b6192a06e78dab8b53994f812d24f50874eb5 Mon Sep 17 00:00:00 2001 From: Aaron Daniels Date: Tue, 28 Jul 2015 07:17:53 +1000 Subject: [PATCH] Added Poller modules for Cisco Voice Routers Added the following modules: - Cisco PRI - graphs the total and inuse Primary Rate ISDN channels. - Cisco DSP - graphs the total and inuse Digital Signal Processor (DSP) resources. - Cisco MTP - graphs the total and inuse Media Termination Point (MTP) resources. - Cisco XCode - graphs the total and inuse Transcoder resources. --- html/includes/graphs/device/cisco-dsp.inc.php | 34 +++++++++++++++ .../graphs/device/cisco-hwmtp.inc.php | 34 +++++++++++++++ html/includes/graphs/device/cisco-pri.inc.php | 34 +++++++++++++++ .../graphs/device/cisco-xcode.inc.php | 34 +++++++++++++++ includes/defaults.inc.php | 4 ++ includes/definitions.inc.php | 16 +++++++ includes/polling/cisco-dsp.inc.php | 38 +++++++++++++++++ includes/polling/cisco-hwmtp.inc.php | 37 ++++++++++++++++ includes/polling/cisco-pri.inc.php | 42 +++++++++++++++++++ includes/polling/cisco-xcode.inc.php | 37 ++++++++++++++++ 10 files changed, 310 insertions(+) create mode 100644 html/includes/graphs/device/cisco-dsp.inc.php create mode 100644 html/includes/graphs/device/cisco-hwmtp.inc.php create mode 100644 html/includes/graphs/device/cisco-pri.inc.php create mode 100644 html/includes/graphs/device/cisco-xcode.inc.php create mode 100644 includes/polling/cisco-dsp.inc.php create mode 100644 includes/polling/cisco-hwmtp.inc.php create mode 100644 includes/polling/cisco-pri.inc.php create mode 100644 includes/polling/cisco-xcode.inc.php diff --git a/html/includes/graphs/device/cisco-dsp.inc.php b/html/includes/graphs/device/cisco-dsp.inc.php new file mode 100644 index 0000000000..7458ce424f --- /dev/null +++ b/html/includes/graphs/device/cisco-dsp.inc.php @@ -0,0 +1,34 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +include("includes/graphs/common.inc.php"); +$rrd_options .= " -l 0 -E "; +$rrd_filename = $config['rrd_dir']."/".$device['hostname']."/cisco-dsp.rrd"; + +if (file_exists($rrd_filename)) +{ + $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " DEF:Total=" . $rrd_filename . ":total:AVERAGE "; + $rrd_options .= " AREA:Total#c099ff "; + $rrd_options .= " LINE1.25:Total#0000ee:'DSPs total ' "; + $rrd_options .= " GPRINT:Total:LAST:%3.0lf "; + $rrd_options .= " GPRINT:Total:MIN:%3.0lf "; + $rrd_options .= " GPRINT:Total:MAX:%3.0lf\\\l "; + + $rrd_options .= " DEF:Active=" . $rrd_filename . ":active:AVERAGE "; + $rrd_options .= " AREA:Active#aaff99 "; + $rrd_options .= " LINE1.25:Active#00ee00:'DSPs in use ' "; + $rrd_options .= " GPRINT:Active:LAST:%3.0lf "; + $rrd_options .= " GPRINT:Active:MIN:%3.0lf "; + $rrd_options .= " GPRINT:Active:MAX:%3.0lf\\\l "; +} \ No newline at end of file diff --git a/html/includes/graphs/device/cisco-hwmtp.inc.php b/html/includes/graphs/device/cisco-hwmtp.inc.php new file mode 100644 index 0000000000..526964a1fe --- /dev/null +++ b/html/includes/graphs/device/cisco-hwmtp.inc.php @@ -0,0 +1,34 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +include("includes/graphs/common.inc.php"); +$rrd_options .= " -l 0 -E "; +$rrd_filename = $config['rrd_dir']."/".$device['hostname']."/cisco-hwmtp.rrd"; + +if (file_exists($rrd_filename)) +{ + $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " DEF:Total=" . $rrd_filename . ":total:AVERAGE "; + $rrd_options .= " AREA:Total#c099ff "; + $rrd_options .= " LINE1.25:Total#0000ee:'Hardware MTP total ' "; + $rrd_options .= " GPRINT:Total:LAST:%3.0lf "; + $rrd_options .= " GPRINT:Total:MIN:%3.0lf "; + $rrd_options .= " GPRINT:Total:MAX:%3.0lf\\\l "; + + $rrd_options .= " DEF:Active=" . $rrd_filename . ":active:AVERAGE "; + $rrd_options .= " AREA:Active#aaff99 "; + $rrd_options .= " LINE1.25:Active#00ee00:'Hardware MTP in use ' "; + $rrd_options .= " GPRINT:Active:LAST:%3.0lf "; + $rrd_options .= " GPRINT:Active:MIN:%3.0lf "; + $rrd_options .= " GPRINT:Active:MAX:%3.0lf\\\l "; +} \ No newline at end of file diff --git a/html/includes/graphs/device/cisco-pri.inc.php b/html/includes/graphs/device/cisco-pri.inc.php new file mode 100644 index 0000000000..29aa861abf --- /dev/null +++ b/html/includes/graphs/device/cisco-pri.inc.php @@ -0,0 +1,34 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +include("includes/graphs/common.inc.php"); +$rrd_options .= " -l 0 -E "; +$rrd_filename = $config['rrd_dir']."/".$device['hostname']."/cisco-pri.rrd"; + +if (file_exists($rrd_filename)) +{ + $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " DEF:Total=" . $rrd_filename . ":total:AVERAGE "; + $rrd_options .= " AREA:Total#c099ff "; + $rrd_options .= " LINE1.25:Total#0000ee:'PRI Channels total ' "; + $rrd_options .= " GPRINT:Total:LAST:%3.0lf "; + $rrd_options .= " GPRINT:Total:MIN:%3.0lf "; + $rrd_options .= " GPRINT:Total:MAX:%3.0lf\\\l "; + + $rrd_options .= " DEF:Active=" . $rrd_filename . ":active:AVERAGE "; + $rrd_options .= " AREA:Active#aaff99 "; + $rrd_options .= " LINE1.25:Active#00ee00:'PRI Channels in use ' "; + $rrd_options .= " GPRINT:Active:LAST:%3.0lf "; + $rrd_options .= " GPRINT:Active:MIN:%3.0lf "; + $rrd_options .= " GPRINT:Active:MAX:%3.0lf\\\l "; +} \ No newline at end of file diff --git a/html/includes/graphs/device/cisco-xcode.inc.php b/html/includes/graphs/device/cisco-xcode.inc.php new file mode 100644 index 0000000000..362e16ba4e --- /dev/null +++ b/html/includes/graphs/device/cisco-xcode.inc.php @@ -0,0 +1,34 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +include("includes/graphs/common.inc.php"); +$rrd_options .= " -l 0 -E "; +$rrd_filename = $config['rrd_dir']."/".$device['hostname']."/cisco-xcode.rrd"; + +if (file_exists($rrd_filename)) +{ + $rrd_options .= " COMMENT:' Cur Min Max\\n'"; + $rrd_options .= " DEF:Total=" . $rrd_filename . ":total:AVERAGE "; + $rrd_options .= " AREA:Total#c099ff "; + $rrd_options .= " LINE1.25:Total#0000ee:'Transcoder Resources Total ' "; + $rrd_options .= " GPRINT:Total:LAST:%3.0lf "; + $rrd_options .= " GPRINT:Total:MIN:%3.0lf "; + $rrd_options .= " GPRINT:Total:MAX:%3.0lf\\\l "; + + $rrd_options .= " DEF:Active=" . $rrd_filename . ":active:AVERAGE "; + $rrd_options .= " AREA:Active#aaff99 "; + $rrd_options .= " LINE1.25:Active#00ee00:'Transcoder Resources in use ' "; + $rrd_options .= " GPRINT:Active:LAST:%3.0lf "; + $rrd_options .= " GPRINT:Active:MIN:%3.0lf "; + $rrd_options .= " GPRINT:Active:MAX:%3.0lf\\\l "; +} \ No newline at end of file diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index af6b937dc5..db07ce9f54 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -622,6 +622,10 @@ $config['poller_modules']['entity-physical'] = 1; $config['poller_modules']['applications'] = 1; $config['poller_modules']['cisco-asa-firewall'] = 1; $config['poller_modules']['mib'] = 0; +$config['poller_modules']['cisco-pri'] = 1; +$config['poller_modules']['cisco-dsp'] = 1; +$config['poller_modules']['cisco-hwmtp'] = 1; +$config['poller_modules']['cisco-xcode'] = 1; // List of discovery modules. Need to be in this array to be // considered for execution. diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 62c418707a..91fc8d2593 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1526,6 +1526,22 @@ $config['graph_types']['device']['asa_conns']['section'] = 'firewall'; $config['graph_types']['device']['asa_conns']['order'] = '0'; $config['graph_types']['device']['asa_conns']['descr'] = 'Current connections'; +$config['graph_types']['device']['cisco-pri']['section'] = 'voice'; +$config['graph_types']['device']['cisco-pri']['order'] = '0'; +$config['graph_types']['device']['cisco-pri']['descr'] = 'PRI Utilisation'; + +$config['graph_types']['device']['cisco-dsp']['section'] = 'voice'; +$config['graph_types']['device']['cisco-dsp']['order'] = '0'; +$config['graph_types']['device']['cisco-dsp']['descr'] = 'DSP Utilisation'; + +$config['graph_types']['device']['cisco-hwmtp']['section'] = 'voice'; +$config['graph_types']['device']['cisco-hwmtp']['order'] = '0'; +$config['graph_types']['device']['cisco-hwmtp']['descr'] = 'Hardware MTP Utilisation'; + +$config['graph_types']['device']['cisco-xcode']['section'] = 'voice'; +$config['graph_types']['device']['cisco-xcode']['order'] = '0'; +$config['graph_types']['device']['cisco-xcode']['descr'] = 'Transcoder Utilisation'; + $config['graph_descr']['device_smokeping_in_all'] = 'This is an aggregate graph of the incoming smokeping tests to this host. The line corresponds to the average RTT. The shaded area around each line denotes the standard deviation.'; $config['graph_descr']['device_processor'] = 'This is an aggregate graph of all processors in the system.'; diff --git a/includes/polling/cisco-dsp.inc.php b/includes/polling/cisco-dsp.inc.php new file mode 100644 index 0000000000..20b2b9abf8 --- /dev/null +++ b/includes/polling/cisco-dsp.inc.php @@ -0,0 +1,38 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if ($device['os_group'] == "cisco") { + // Total + $total = 0; + foreach (snmpwalk_cache_oid_num ($device, "1.3.6.1.4.1.9.9.86.1.2.1.1.6", NULL) as $key => $value) { + $total += $value['']; + } + + if (isset($total) && ($total != "") && ($total != 0)) { + // Active + $active = 0; + foreach ( snmpwalk_cache_oid_num ($device, "1.3.6.1.4.1.9.9.86.1.2.1.1.7", NULL) as $key => $value) { + $active += $value['']; + } + + $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename ("cisco-dsp.rrd"); + if (!file_exists ($rrd_filename)) { + rrdtool_create ($rrd_filename, " DS:total:GAUGE:600:0:U DS:active:GAUGE:600:0:U" . $config['rrd_rra']); + } + rrdtool_update ($rrd_filename, "N:" . $total . ":" . $active); + + $graphs['cisco-dsp'] = TRUE; + echo (" Cisco DSP "); + } + unset($rrd_filename, $total, $active); +} \ No newline at end of file diff --git a/includes/polling/cisco-hwmtp.inc.php b/includes/polling/cisco-hwmtp.inc.php new file mode 100644 index 0000000000..12b48f6b64 --- /dev/null +++ b/includes/polling/cisco-hwmtp.inc.php @@ -0,0 +1,37 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if ($device['os_group'] == "cisco") { + // Total + $total = snmpwalk_cache_oid_num ($device, "1.3.6.1.4.1.9.9.86.1.6.4.1.3", NULL); + $total = $total['1.3.6.1.4.1.9.9.86.1.6.4.1.3']['']; + + if (isset($total) && ($total != "") && ($total != 0)) { + // Available + $available = snmpwalk_cache_oid_num ($device, "1.3.6.1.4.1.9.9.86.1.6.4.1.4", NULL); + $available = $available['1.3.6.1.4.1.9.9.86.1.6.4.1.4']['']; + + // Active + $active = $total - $available; + + $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename ("cisco-hwmtp.rrd"); + if (!file_exists ($rrd_filename)) { + rrdtool_create ($rrd_filename, " DS:total:GAUGE:600:0:U DS:active:GAUGE:600:0:U" . $config['rrd_rra']); + } + rrdtool_update ($rrd_filename, "N:" . $total . ":" . $active); + + $graphs['cisco-hwmtp'] = TRUE; + echo (" Cisco HW MTP "); + } + unset($rrd_filename, $total, $active, $available); +} \ No newline at end of file diff --git a/includes/polling/cisco-pri.inc.php b/includes/polling/cisco-pri.inc.php new file mode 100644 index 0000000000..a2c2835fd3 --- /dev/null +++ b/includes/polling/cisco-pri.inc.php @@ -0,0 +1,42 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if ($device['os_group'] == "cisco") { + // TODO: Need to test partial PRI. + + // Total + $total = 0; + foreach ( snmpwalk_cache_oid_num ($device, "1.3.6.1.2.1.2.2.1.3", NULL) as $key => $value) { + // 81 is the ifType for DS0's + if ($value[''] == "81") { + $total++; + } + } + + // Active + $active = snmpwalk_cache_oid_num ($device, "1.3.6.1.4.1.9.10.19.1.1.4.0", NULL); + $active = $active['1.3.6.1.4.1.9.10.19.1.1.4.0']['']; + + if (isset($active) && ($active != "") && ($total != 0)) { + $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename ("cisco-pri.rrd"); + + if (!file_exists ($rrd_filename)) { + rrdtool_create ($rrd_filename, " DS:total:GAUGE:600:0:U DS:active:GAUGE:600:0:U" . $config['rrd_rra']); + } + rrdtool_update ($rrd_filename, "N:" . $total . ":" . $active); + + $graphs['cisco-pri'] = TRUE; + echo (" Cisco PRI "); + } + unset($rrd_filename, $total, $active); +} \ No newline at end of file diff --git a/includes/polling/cisco-xcode.inc.php b/includes/polling/cisco-xcode.inc.php new file mode 100644 index 0000000000..b4b1f8096f --- /dev/null +++ b/includes/polling/cisco-xcode.inc.php @@ -0,0 +1,37 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if ($device['os_group'] == "cisco") { + // Total + $total = snmpwalk_cache_oid_num ($device, "1.3.6.1.4.1.9.9.86.1.7.1.0", NULL); + $total = $total['1.3.6.1.4.1.9.9.86.1.7.1.0']['']; + + if (isset($total) && ($total != "") && ($total != 0)) { + // Available + $available = snmpwalk_cache_oid_num ($device, "1.3.6.1.4.1.9.9.86.1.7.2.0", NULL); + $available = $available['1.3.6.1.4.1.9.9.86.1.7.2.0']['']; + + // Active + $active = $total - $available; + + $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename ("cisco-xcode.rrd"); + if (!file_exists ($rrd_filename)) { + rrdtool_create ($rrd_filename, " DS:total:GAUGE:600:0:U DS:active:GAUGE:600:0:U" . $config['rrd_rra']); + } + rrdtool_update ($rrd_filename, "N:" . $total . ":" . $active); + + $graphs['cisco-xcode'] = TRUE; + echo (" Cisco Transcoder "); + } + unset($rrd_filename, $total, $active, $available); +} \ No newline at end of file