Added Cisco-voice IP graphs (#10538)

* Cisco VoIP stats

* Cisco VoIP stats

* codeclimate

* codeclimate
This commit is contained in:
PipoCanaja
2019-08-20 18:26:44 +02:00
committed by Tony Murray
parent 36c41bac2c
commit d6862b0e34
4 changed files with 110 additions and 0 deletions

View File

@@ -434,6 +434,10 @@ $config['graph_types']['device']['cisco-iospri']['section'] = 'voice';
$config['graph_types']['device']['cisco-iospri']['order'] = '0';
$config['graph_types']['device']['cisco-iospri']['descr'] = 'PRI Utilisation';
$config['graph_types']['device']['cisco-voice-ip']['section'] = 'voice';
$config['graph_types']['device']['cisco-voice-ip']['order'] = '0';
$config['graph_types']['device']['cisco-voice-ip']['descr'] = 'IP Real Time Calls';
$config['graph_types']['device']['cisco-iosdsp']['section'] = 'voice';
$config['graph_types']['device']['cisco-iosdsp']['order'] = '0';
$config['graph_types']['device']['cisco-iosdsp']['descr'] = 'DSP Utilisation';

View File

@@ -0,0 +1,58 @@
<?php
/*
* LibreNMS module to Graph Hardware MTP Resources in a Cisco Voice Router
*
* Copyright (c) 2015 Aaron Daniels <aaron@daniels.id.au>
*
* 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/html/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$rrd_filename = rrd_name($device['hostname'], 'cisco-voice-ip');
if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_options .= " COMMENT:' Cur Min Max\\n'";
$rrd_options .= " DEF:sip=" . $rrd_filename . ":sip:AVERAGE ";
$rrd_options .= " DEF:sip_max=". $rrd_filename . ":sip:MAX";
$rrd_options .= " AREA:sip_max#c099ff77 ";
$rrd_options .= " LINE1.25:sip#0000ee:'sip active calls ' ";
$rrd_options .= " GPRINT:sip:LAST:%3.0lf ";
$rrd_options .= " GPRINT:sip:MIN:%3.0lf ";
$rrd_options .= " GPRINT:sip_max:MAX:%3.0lf\\\l ";
$rrd_options .= " DEF:h323=" . $rrd_filename . ":h323:AVERAGE ";
$rrd_options .= " DEF:h323_max=". $rrd_filename . ":h323:MAX";
$rrd_options .= " AREA:h323_max#aaff99dd ";
$rrd_options .= " LINE1.25:h323#00ee00:'h323 active calls ' ";
$rrd_options .= " GPRINT:h323:LAST:%3.0lf ";
$rrd_options .= " GPRINT:h323:MIN:%3.0lf ";
$rrd_options .= " GPRINT:h323_max:MAX:%3.0lf\\\l ";
$rrd_options .= " DEF:mgcp=" . $rrd_filename . ":mgcp:AVERAGE ";
$rrd_options .= " DEF:mgcp_max=". $rrd_filename . ":mgcp:MAX";
$rrd_options .= " AREA:mgcp_max#ffaa99dd ";
$rrd_options .= " LINE1.25:mgcp#ee0000:'mgcp active calls ' ";
$rrd_options .= " GPRINT:mgcp:LAST:%3.0lf ";
$rrd_options .= " GPRINT:mgcp:MIN:%3.0lf ";
$rrd_options .= " GPRINT:mgcp_max:MAX:%3.0lf\\\l ";
$rrd_options .= " DEF:sccp=" . $rrd_filename . ":sccp:AVERAGE ";
$rrd_options .= " DEF:sccp_max=". $rrd_filename . ":sccp:MAX";
$rrd_options .= " AREA:sccp_max#ddffffdd ";
$rrd_options .= " LINE1.25:sccp#99ccff:'sccp active calls ' ";
$rrd_options .= " GPRINT:sccp:LAST:%3.0lf ";
$rrd_options .= " GPRINT:sccp:MIN:%3.0lf ";
$rrd_options .= " GPRINT:sccp_max:MAX:%3.0lf\\\l ";
$rrd_options .= " DEF:multicast=" . $rrd_filename . ":multicast:AVERAGE ";
$rrd_options .= " DEF:multicast_max=". $rrd_filename . ":multicast:MAX";
$rrd_options .= " AREA:multicast_max#ffddffdd ";
$rrd_options .= " LINE1.25:multicast#cc77ff:'multicast active calls ' ";
$rrd_options .= " GPRINT:multicast:LAST:%3.0lf ";
$rrd_options .= " GPRINT:multicast:MIN:%3.0lf ";
$rrd_options .= " GPRINT:multicast_max:MAX:%3.0lf\\\l ";
}

View File

@@ -18,6 +18,12 @@ if ($device['os_group'] == "cisco") {
*/
include "cisco-voice/cisco-iospri.inc.php";
/*
* Cisco IP
* This module graphs the used IP channels on a Cisco Voice Gateway
*/
include "cisco-voice/cisco-ip.inc.php";
/*
* Cisco DSP
* This module graphs the used and total DSP resources on a Cisco Voice Gateway

View File

@@ -0,0 +1,42 @@
<?php
/*
* LibreNMS module to IP active connections in a Cisco Voice Router
*
* Copyright (c) 2019 PipoCanaja
*
* 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.
*/
use LibreNMS\RRD\RrdDefinition;
if ($device['os_group'] == "cisco") {
$output = snmpwalk_cache_oid($device, "cvCallVolConnActiveConnection", [], "CISCO-VOICE-DIAL-CONTROL-MIB");
d_echo($output);
if (is_array($output)) {
$rrd_def = RrdDefinition::make()
->addDataset('h323', 'GAUGE', 0)
->addDataset('sip', 'GAUGE', 0)
->addDataset('mgcp', 'GAUGE', 0)
->addDataset('sccp', 'GAUGE', 0)
->addDataset('multicast', 'GAUGE', 0);
$fields = array(
'h323' => $output['h323']['cvCallVolConnActiveConnection'],
'sip' => $output['sip']['cvCallVolConnActiveConnection'],
'mgcp' => $output['mgcp']['cvCallVolConnActiveConnection'],
'sccp' => $output['sccp']['cvCallVolConnActiveConnection'],
'multicast' => $output['multicast']['cvCallVolConnActiveConnection'],
);
d_echo($fields);
$tags = compact('rrd_def');
data_update($device, 'cisco-voice-ip', $tags, $fields);
$graphs['cisco-voice-ip'] = true;
echo(" Cisco IOS Voice IP ");
unset($rrd_def, $active, $fields, $tags);
}
}