mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
// Polls MailScanner statistics from script via SNMP
|
|
|
|
$options = '-O qv';
|
|
$oid = 'nsExtendOutputFull.11.109.97.105.108.115.99.97.110.110.101.114';
|
|
|
|
$mailscanner = snmp_get($device, $oid, $options);
|
|
|
|
echo ' mailscanner';
|
|
|
|
list ($msg_recv, $msg_rejected, $msg_relay, $msg_sent, $msg_waiting, $spam, $virus) = explode("\n", $mailscanner);
|
|
|
|
$name = 'mailscannerV2';
|
|
$app_id = $app['app_id'];
|
|
$rrd_name = array('app', $name, $app_id);
|
|
$rrd_def = array(
|
|
'DS:msg_recv:COUNTER:600:0:125000000000',
|
|
'DS:msg_rejected:COUNTER:600:0:12500000000',
|
|
'DS:msg_relay:COUNTER:600:0:125000000000',
|
|
'DS:msg_sent:COUNTER:600:0:125000000000',
|
|
'DS:msg_waiting:COUNTER:600:0:125000000000',
|
|
'DS:spam:COUNTER:600:0:125000000000',
|
|
'DS:virus:COUNTER:600:0:125000000000'
|
|
);
|
|
|
|
$fields = array(
|
|
'msg_recv' => $msg_recv,
|
|
'msg_rejected' => $msg_rejected,
|
|
'msg_relay' => $msg_relay,
|
|
'msg_sent' => $msg_sent,
|
|
'msg_waiting' => $msg_waiting,
|
|
'spam' => $spam,
|
|
'virus' => $virus,
|
|
);
|
|
|
|
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
|
data_update($device, 'app', $tags, $fields);
|