Fixed the snmp wizard for uptime and added unit octets. TICKET: #1742
(cherry picked from commit 584d00f321
)
This commit is contained in:
parent
f19f971273
commit
ab12b4456a
|
@ -75,8 +75,8 @@ $static_snmp_descriptions = array(
|
||||||
'ssRawContexts' => 'Number of context switches',
|
'ssRawContexts' => 'Number of context switches',
|
||||||
'ssCpuRawUser' => 'user CPU time',
|
'ssCpuRawUser' => 'user CPU time',
|
||||||
'ssCpuRawSystem' => 'system CPU time',
|
'ssCpuRawSystem' => 'system CPU time',
|
||||||
'ssCpuRawIdle' => 'idle CPU time'
|
'ssCpuRawIdle' => 'idle CPU time',
|
||||||
);
|
'sysUpTime' => 'system Up time');
|
||||||
|
|
||||||
$static_snmp_oids = array(
|
$static_snmp_oids = array(
|
||||||
'Load-1' => '.1.3.6.1.4.1.2021.10.1.5.1',
|
'Load-1' => '.1.3.6.1.4.1.2021.10.1.5.1',
|
||||||
|
@ -98,8 +98,11 @@ $static_snmp_oids = array(
|
||||||
'ssRawContexts' => '.1.3.6.1.4.1.2021.11.60.0',
|
'ssRawContexts' => '.1.3.6.1.4.1.2021.11.60.0',
|
||||||
'ssCpuRawUser' => '.1.3.6.1.4.1.2021.11.50.0',
|
'ssCpuRawUser' => '.1.3.6.1.4.1.2021.11.50.0',
|
||||||
'ssCpuRawSystem' => '.1.3.6.1.4.1.2021.11.52.0',
|
'ssCpuRawSystem' => '.1.3.6.1.4.1.2021.11.52.0',
|
||||||
'ssCpuRawIdle' => '.1.3.6.1.4.1.2021.11.53.0'
|
'ssCpuRawIdle' => '.1.3.6.1.4.1.2021.11.53.0',
|
||||||
);
|
'sysUpTime' => '1.3.6.1.2.1.1.3.0');
|
||||||
|
|
||||||
|
$static_snmp_post_process = array(
|
||||||
|
'sysUpTime' => "0.00000011574074");
|
||||||
|
|
||||||
// Using plugin
|
// Using plugin
|
||||||
if (!empty($plugin)) {
|
if (!empty($plugin)) {
|
||||||
|
@ -450,6 +453,10 @@ if ($create_modules) {
|
||||||
|
|
||||||
$module_values['descripcion'] = $static_snmp_descriptions[$snmpdata_name];
|
$module_values['descripcion'] = $static_snmp_descriptions[$snmpdata_name];
|
||||||
$module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp');
|
$module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp');
|
||||||
|
if (isset($static_snmp_post_process[$snmpdata_name])) {
|
||||||
|
$module_values['post_process'] =
|
||||||
|
$static_snmp_post_process[$snmpdata_name];
|
||||||
|
}
|
||||||
|
|
||||||
//Average use of CPUs is a plugin module
|
//Average use of CPUs is a plugin module
|
||||||
switch ($snmpdata_name) {
|
switch ($snmpdata_name) {
|
||||||
|
@ -656,7 +663,8 @@ if ($create_modules) {
|
||||||
unset($module_values['ip_target']); //ip_target
|
unset($module_values['ip_target']); //ip_target
|
||||||
unset($module_values['tcp_send']); //snmp_version
|
unset($module_values['tcp_send']); //snmp_version
|
||||||
|
|
||||||
$result = modules_create_agent_module($id_agent, io_safe_input($disk), $module_values);
|
$result = modules_create_agent_module($id_agent,
|
||||||
|
io_safe_input($disk), $module_values);
|
||||||
|
|
||||||
$results[$result][] = $disk;
|
$results[$result][] = $disk;
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,6 +202,10 @@ if ($create_modules) {
|
||||||
else
|
else
|
||||||
$module_type = 15;
|
$module_type = 15;
|
||||||
|
|
||||||
|
if (preg_match("/Octets/", $name_array[1])) {
|
||||||
|
$values['unit'] = "Bytes";
|
||||||
|
}
|
||||||
|
|
||||||
$values['id_tipo_modulo'] = $module_type;
|
$values['id_tipo_modulo'] = $module_type;
|
||||||
|
|
||||||
if (!empty($ifPhysAddress))
|
if (!empty($ifPhysAddress))
|
||||||
|
|
Loading…
Reference in New Issue