mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove nfs requirement for distributed poller (with rrdtool 1.5+)
Use data_update instead of rrd_update/rrd_create and influx_update Centralize rrd file check so we can check against a remote rrdcached server too Use rrd_name() to generate rrd file names
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
// Polls Apache statistics from script via SNMP
|
||||
if (!empty($agent_data['app']['apache'])) {
|
||||
$apache = $agent_data['app']['apache'];
|
||||
$name = 'apache';
|
||||
$app_id = $app['app_id'];
|
||||
if (!empty($agent_data['app'][$name])) {
|
||||
$apache = $agent_data['app'][$name];
|
||||
}
|
||||
else {
|
||||
$options = '-O qv';
|
||||
@@ -10,8 +12,6 @@ else {
|
||||
$apache = snmp_get($device, $oid, $options);
|
||||
}
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-apache-'.$app['app_id'].'.rrd';
|
||||
|
||||
echo ' apache';
|
||||
|
||||
list ($total_access, $total_kbyte, $cpuload, $uptime, $reqpersec, $bytespersec,
|
||||
@@ -19,32 +19,29 @@ list ($total_access, $total_kbyte, $cpuload, $uptime, $reqpersec, $bytespersec,
|
||||
$score_reading, $score_writing, $score_keepalive, $score_dns,
|
||||
$score_closing, $score_logging, $score_graceful, $score_idle, $score_open) = explode("\n", $apache);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:access:DERIVE:600:0:125000000000
|
||||
DS:kbyte:DERIVE:600:0:125000000000
|
||||
DS:cpu:GAUGE:600:0:125000000000
|
||||
DS:uptime:GAUGE:600:0:125000000000
|
||||
DS:reqpersec:GAUGE:600:0:125000000000
|
||||
DS:bytespersec:GAUGE:600:0:125000000000
|
||||
DS:byesperreq:GAUGE:600:0:125000000000
|
||||
DS:busyworkers:GAUGE:600:0:125000000000
|
||||
DS:idleworkers:GAUGE:600:0:125000000000
|
||||
DS:sb_wait:GAUGE:600:0:125000000000
|
||||
DS:sb_start:GAUGE:600:0:125000000000
|
||||
DS:sb_reading:GAUGE:600:0:125000000000
|
||||
DS:sb_writing:GAUGE:600:0:125000000000
|
||||
DS:sb_keepalive:GAUGE:600:0:125000000000
|
||||
DS:sb_dns:GAUGE:600:0:125000000000
|
||||
DS:sb_closing:GAUGE:600:0:125000000000
|
||||
DS:sb_logging:GAUGE:600:0:125000000000
|
||||
DS:sb_graceful:GAUGE:600:0:125000000000
|
||||
DS:sb_idle:GAUGE:600:0:125000000000
|
||||
DS:sb_open:GAUGE:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}//end if
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:access:DERIVE:600:0:125000000000',
|
||||
'DS:kbyte:DERIVE:600:0:125000000000',
|
||||
'DS:cpu:GAUGE:600:0:125000000000',
|
||||
'DS:uptime:GAUGE:600:0:125000000000',
|
||||
'DS:reqpersec:GAUGE:600:0:125000000000',
|
||||
'DS:bytespersec:GAUGE:600:0:125000000000',
|
||||
'DS:byesperreq:GAUGE:600:0:125000000000',
|
||||
'DS:busyworkers:GAUGE:600:0:125000000000',
|
||||
'DS:idleworkers:GAUGE:600:0:125000000000',
|
||||
'DS:sb_wait:GAUGE:600:0:125000000000',
|
||||
'DS:sb_start:GAUGE:600:0:125000000000',
|
||||
'DS:sb_reading:GAUGE:600:0:125000000000',
|
||||
'DS:sb_writing:GAUGE:600:0:125000000000',
|
||||
'DS:sb_keepalive:GAUGE:600:0:125000000000',
|
||||
'DS:sb_dns:GAUGE:600:0:125000000000',
|
||||
'DS:sb_closing:GAUGE:600:0:125000000000',
|
||||
'DS:sb_logging:GAUGE:600:0:125000000000',
|
||||
'DS:sb_graceful:GAUGE:600:0:125000000000',
|
||||
'DS:sb_idle:GAUGE:600:0:125000000000',
|
||||
'DS:sb_open:GAUGE:600:0:125000000000'
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'access' => $total_access,
|
||||
@@ -69,8 +66,6 @@ $fields = array(
|
||||
'sb_open' => $score_open,
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
|
||||
$tags = array('name' => 'apache', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
|
||||
@@ -24,10 +24,11 @@
|
||||
* @subpackage Polling
|
||||
*/
|
||||
|
||||
if (!empty($agent_data['app']['bind']) && $app['app_id'] > 0) {
|
||||
$name = 'bind';
|
||||
$app_id = $app['app_id'];
|
||||
if (!empty($agent_data['app'][$name]) && $app_id > 0) {
|
||||
echo ' bind ';
|
||||
$bind = $agent_data['app']['bind'];
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-bind-'.$app['app_id'].'.rrd';
|
||||
$bind = $agent_data['app'][$name];
|
||||
$bind_parsed = array();
|
||||
$prefix = '';
|
||||
foreach (explode("\n", $bind) as $line) {
|
||||
@@ -69,39 +70,34 @@ if (!empty($agent_data['app']['bind']) && $app['app_id'] > 0) {
|
||||
}
|
||||
}//end foreach
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:any:COUNTER:600:0:125000000000
|
||||
DS:a:COUNTER:600:0:125000000000
|
||||
DS:aaaa:COUNTER:600:0:125000000000
|
||||
DS:cname:COUNTER:600:0:125000000000
|
||||
DS:mx:COUNTER:600:0:125000000000
|
||||
DS:ns:COUNTER:600:0:125000000000
|
||||
DS:ptr:COUNTER:600:0:125000000000
|
||||
DS:soa:COUNTER:600:0:125000000000
|
||||
DS:srv:COUNTER:600:0:125000000000
|
||||
DS:spf:COUNTER:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
|
||||
$fields = array(
|
||||
'any' => ((int) $bind_parsed['incoming_queries']['any']),
|
||||
'a' => ((int) $bind_parsed['incoming_queries']['a']),
|
||||
'aaaa' => ((int) $bind_parsed['incoming_queries']['aaaa']),
|
||||
'cname' => ((int) $bind_parsed['incoming_queries']['cname']),
|
||||
'mx' => ((int) $bind_parsed['incoming_queries']['mx']),
|
||||
'ns' => ((int) $bind_parsed['incoming_queries']['ns']),
|
||||
'ptr' => ((int) $bind_parsed['incoming_queries']['ptr']),
|
||||
'soa' => ((int) $bind_parsed['incoming_queries']['soa']),
|
||||
'srv' => ((int) $bind_parsed['incoming_queries']['srv']),
|
||||
'spf' => ((int) $bind_parsed['incoming_queries']['spf']),
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:any:COUNTER:600:0:125000000000',
|
||||
'DS:a:COUNTER:600:0:125000000000',
|
||||
'DS:aaaa:COUNTER:600:0:125000000000',
|
||||
'DS:cname:COUNTER:600:0:125000000000',
|
||||
'DS:mx:COUNTER:600:0:125000000000',
|
||||
'DS:ns:COUNTER:600:0:125000000000',
|
||||
'DS:ptr:COUNTER:600:0:125000000000',
|
||||
'DS:soa:COUNTER:600:0:125000000000',
|
||||
'DS:srv:COUNTER:600:0:125000000000',
|
||||
'DS:spf:COUNTER:600:0:125000000000'
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
$fields = array(
|
||||
'any' => ((int)$bind_parsed['incoming_queries']['any']),
|
||||
'a' => ((int)$bind_parsed['incoming_queries']['a']),
|
||||
'aaaa' => ((int)$bind_parsed['incoming_queries']['aaaa']),
|
||||
'cname' => ((int)$bind_parsed['incoming_queries']['cname']),
|
||||
'mx' => ((int)$bind_parsed['incoming_queries']['mx']),
|
||||
'ns' => ((int)$bind_parsed['incoming_queries']['ns']),
|
||||
'ptr' => ((int)$bind_parsed['incoming_queries']['ptr']),
|
||||
'soa' => ((int)$bind_parsed['incoming_queries']['soa']),
|
||||
'srv' => ((int)$bind_parsed['incoming_queries']['srv']),
|
||||
'spf' => ((int)$bind_parsed['incoming_queries']['spf']),
|
||||
);
|
||||
|
||||
$tags = array('name' => 'bind', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
}//end if
|
||||
|
||||
@@ -1,31 +1,34 @@
|
||||
<?php
|
||||
|
||||
if (!empty($agent_data['app']['ceph'])) {
|
||||
|
||||
$ceph_rrddir = join('/', array($config['rrd_dir'], $device['hostname']));
|
||||
$name = 'ceph';
|
||||
if (!empty($agent_data['app'][$name])) {
|
||||
$app_id = $app['app_id'];
|
||||
|
||||
foreach (explode('<', $agent_raw) as $section) {
|
||||
if (empty($section))
|
||||
continue;
|
||||
list($section, $data) = explode('>', $section);
|
||||
|
||||
if ($section == "poolstats") {
|
||||
foreach (explode("\n", $data) as $line) {
|
||||
if (empty($line))
|
||||
continue;
|
||||
list($pool,$ops,$wrbytes,$rbytes) = explode(':', $line);
|
||||
$ceph_rrd = $ceph_rrddir.'/app-ceph-'.$app['app_id'].'-pool-'.$pool.'.rrd';
|
||||
if (!is_file($ceph_rrd)) {
|
||||
rrdtool_create(
|
||||
$ceph_rrd,
|
||||
'--step 300
|
||||
DS:ops:GAUGE:600:0:U
|
||||
DS:wrbytes:GAUGE:600:0:U
|
||||
DS:rbytes:GAUGE:600:0:U '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
$rrd_name = array('app', $name, $app_id, 'pool'.$pool);
|
||||
$rrd_def = array(
|
||||
'DS:ops:GAUGE:600:0:U',
|
||||
'DS:wrbytes:GAUGE:600:0:U',
|
||||
'DS:rbytes:GAUGE:600:0:U'
|
||||
);
|
||||
|
||||
print "Ceph Pool: $pool, IOPS: $ops, Wr bytes: $wrbytes, R bytes: $rbytes\n";
|
||||
rrdtool_update($ceph_rrd, array("ops" => $ops, "wrbytes" => $wrbytes, "rbytes" => $rbytes));
|
||||
$fields = array(
|
||||
'ops' => $ops,
|
||||
'wrbytes' => $wrbytes,
|
||||
'rbytes' => $rbytes
|
||||
);
|
||||
$tags = compact($name, $app_id, $pool, $rrd_name, $rrd_def);
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
}
|
||||
}
|
||||
elseif ($section == "osdperformance") {
|
||||
@@ -33,38 +36,43 @@ if (!empty($agent_data['app']['ceph'])) {
|
||||
if (empty($line))
|
||||
continue;
|
||||
list($osd,$apply,$commit) = explode(':', $line);
|
||||
$ceph_rrd = $ceph_rrddir.'/app-ceph-'.$app['app_id'].'-osd-'.$osd.'.rrd';
|
||||
if (!is_file($ceph_rrd)) {
|
||||
rrdtool_create(
|
||||
$ceph_rrd,
|
||||
'--step 300
|
||||
DS:apply_ms:GAUGE:600:0:U
|
||||
DS:commit_ms:GAUGE:600:0:U '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
$rrd_name = array('app', $name, $app_id, 'osd'.$osd);
|
||||
$rrd_def = array(
|
||||
'DS:apply_ms:GAUGE:600:0:U',
|
||||
'DS:commit_ms:GAUGE:600:0:U'
|
||||
);
|
||||
|
||||
|
||||
print "Ceph OSD: $osd, Apply: $apply, Commit: $commit\n";
|
||||
rrdtool_update($ceph_rrd, array("apply_ms" => $apply, "commit_ms" => $commit));
|
||||
$fields = array(
|
||||
'apply_ms' => $apply,
|
||||
'commit_ms' => $commit
|
||||
);
|
||||
$tags = compact($name, $app_id, $osd, $rrd_name, $rrd_def);
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
}
|
||||
}
|
||||
elseif ($section == "df") {
|
||||
foreach (explode("\n", $data) as $line) {
|
||||
if (empty($line))
|
||||
continue;
|
||||
list($pool,$avail,$used,$objects) = explode(':', $line);
|
||||
$ceph_rrd = $ceph_rrddir.'/app-ceph-'.$app['app_id'].'-df-'.$pool.'.rrd';
|
||||
if (!is_file($ceph_rrd)) {
|
||||
rrdtool_create(
|
||||
$ceph_rrd,
|
||||
'--step 300
|
||||
DS:avail:GAUGE:600:0:U
|
||||
DS:used:GAUGE:600:0:U
|
||||
DS:objects:GAUGE:600:0:U '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
list($df,$avail,$used,$objects) = explode(':', $line);
|
||||
$rrd_name = array('app', $name, $app_id, 'df', $df);
|
||||
$rrd_def = array(
|
||||
'DS:avail:GAUGE:600:0:U',
|
||||
'DS:used:GAUGE:600:0:U',
|
||||
'DS:objects:GAUGE:600:0:U'
|
||||
);
|
||||
|
||||
print "Ceph Pool DF: $pool, Avail: $avail, Used: $used, Objects: $objects\n";
|
||||
rrdtool_update($ceph_rrd, array("avail" => $avail, "used" => $used, "objects" => $objects));
|
||||
$fields = array(
|
||||
'avail' => $avail,
|
||||
'used' => $used,
|
||||
'objects' => $objects
|
||||
);
|
||||
|
||||
$tags = compact($name, $app_id, $df, $rrd_name, $rrd_def);
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-drbd-'.$app['app_instance'].'.rrd';
|
||||
|
||||
foreach (explode('|', $agent_data['app']['drbd'][$app['app_instance']]) as $part) {
|
||||
$name = 'drbd';
|
||||
$app_instance = $app['app_instance'];
|
||||
$app_id = $app['app_id'];
|
||||
foreach (explode('|', $agent_data['app'][$name][$app_instance]) as $part) {
|
||||
list($stat, $val) = explode('=', $part);
|
||||
if (!empty($stat)) {
|
||||
$drbd[$stat] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:ns:DERIVE:600:0:125000000000
|
||||
DS:nr:DERIVE:600:0:125000000000
|
||||
DS:dw:DERIVE:600:0:125000000000
|
||||
DS:dr:DERIVE:600:0:125000000000
|
||||
DS:al:DERIVE:600:0:125000000000
|
||||
DS:bm:DERIVE:600:0:125000000000
|
||||
DS:lo:GAUGE:600:0:125000000000
|
||||
DS:pe:GAUGE:600:0:125000000000
|
||||
DS:ua:GAUGE:600:0:125000000000
|
||||
DS:ap:GAUGE:600:0:125000000000
|
||||
DS:oos:GAUGE:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
$rrd_name = array('app', $name, $app_instance);
|
||||
$rrd_def = array(
|
||||
'DS:ns:DERIVE:600:0:125000000000',
|
||||
'DS:nr:DERIVE:600:0:125000000000',
|
||||
'DS:dw:DERIVE:600:0:125000000000',
|
||||
'DS:dr:DERIVE:600:0:125000000000',
|
||||
'DS:al:DERIVE:600:0:125000000000',
|
||||
'DS:bm:DERIVE:600:0:125000000000',
|
||||
'DS:lo:GAUGE:600:0:125000000000',
|
||||
'DS:pe:GAUGE:600:0:125000000000',
|
||||
'DS:ua:GAUGE:600:0:125000000000',
|
||||
'DS:ap:GAUGE:600:0:125000000000',
|
||||
'DS:oos:GAUGE:600:0:125000000000'
|
||||
);
|
||||
|
||||
|
||||
$fields = array(
|
||||
'ns' => $drbd['ns'],
|
||||
@@ -41,9 +41,7 @@ $fields = array(
|
||||
'oos' => $drbd['oos'],
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
|
||||
$tags = array('name' => 'drbd', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = array('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
unset($drbd);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
// Polls MailScanner statistics from script via SNMP
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mailscannerV2-'.$app['app_id'].'.rrd';
|
||||
|
||||
$options = '-O qv';
|
||||
$oid = 'nsExtendOutputFull.11.109.97.105.108.115.99.97.110.110.101.114';
|
||||
|
||||
@@ -11,32 +11,29 @@ echo ' mailscanner';
|
||||
|
||||
list ($msg_recv, $msg_rejected, $msg_relay, $msg_sent, $msg_waiting, $spam, $virus) = explode("\n", $mailscanner);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:msg_recv:COUNTER:600:0:125000000000
|
||||
DS:msg_rejected:COUNTER:600:0:125000000000
|
||||
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 '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
|
||||
$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,
|
||||
$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'
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
$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 = array('name' => 'mailscannerV2', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
|
||||
@@ -1,36 +1,32 @@
|
||||
<?php
|
||||
|
||||
$data = $agent_data['app']['memcached'][$app['app_instance']];
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-memcached-'.$app['app_id'].'.rrd';
|
||||
$name = 'memcached';
|
||||
$app_id = $app['app_id'];
|
||||
$data = $agent_data['app'][$name][$app['app_instance']];
|
||||
|
||||
echo ' memcached('.$app['app_instance'].')';
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:uptime:GAUGE:600:0:125000000000
|
||||
DS:threads:GAUGE:600:0:125000000000
|
||||
DS:rusage_user_ms:DERIVE:600:0:125000000000
|
||||
DS:rusage_system_ms:DERIVE:600:0:125000000000
|
||||
DS:curr_items:GAUGE:600:0:125000000000
|
||||
DS:total_items:DERIVE:600:0:125000000000
|
||||
DS:limit_maxbytes:GAUGE:600:0:125000000000
|
||||
DS:curr_connections:GAUGE:600:0:125000000000
|
||||
DS:total_connections:DERIVE:600:0:125000000000
|
||||
DS:conn_structures:GAUGE:600:0:125000000000
|
||||
DS:bytes:GAUGE:600:0:125000000000
|
||||
DS:cmd_get:DERIVE:600:0:125000000000
|
||||
DS:cmd_set:DERIVE:600:0:125000000000
|
||||
DS:get_hits:DERIVE:600:0:125000000000
|
||||
DS:get_misses:DERIVE:600:0:125000000000
|
||||
DS:evictions:DERIVE:600:0:125000000000
|
||||
DS:bytes_read:DERIVE:600:0:125000000000
|
||||
DS:bytes_written:DERIVE:600:0:125000000000
|
||||
'.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:uptime:GAUGE:600:0:125000000000',
|
||||
'DS:threads:GAUGE:600:0:125000000000',
|
||||
'DS:rusage_user_ms:DERIVE:600:0:125000000000',
|
||||
'DS:rusage_system_ms:DERIVE:600:0:125000000000',
|
||||
'DS:curr_items:GAUGE:600:0:125000000000',
|
||||
'DS:total_items:DERIVE:600:0:125000000000',
|
||||
'DS:limit_maxbytes:GAUGE:600:0:125000000000',
|
||||
'DS:curr_connections:GAUGE:600:0:125000000000',
|
||||
'DS:total_connections:DERIVE:600:0:125000000000',
|
||||
'DS:conn_structures:GAUGE:600:0:125000000000',
|
||||
'DS:bytes:GAUGE:600:0:125000000000',
|
||||
'DS:cmd_get:DERIVE:600:0:125000000000',
|
||||
'DS:cmd_set:DERIVE:600:0:125000000000',
|
||||
'DS:get_hits:DERIVE:600:0:125000000000',
|
||||
'DS:get_misses:DERIVE:600:0:125000000000',
|
||||
'DS:evictions:DERIVE:600:0:125000000000',
|
||||
'DS:bytes_read:DERIVE:600:0:125000000000',
|
||||
'DS:bytes_written:DERIVE:600:0:125000000000'
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'uptime' => $data['uptime'],
|
||||
@@ -53,8 +49,6 @@ $fields = array(
|
||||
'bytes_written' => $data['bytes_written'],
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
|
||||
$tags = array('name' => 'memcached', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
// FIXME - this is lame
|
||||
if (!empty($agent_data['app']['mysql'])) {
|
||||
$mysql = $agent_data['app']['mysql'];
|
||||
$name = 'mysql';
|
||||
$app_id = $app['app_id'];
|
||||
if (!empty($agent_data['app'][$name])) {
|
||||
$mysql = $agent_data['app'][$name];
|
||||
}
|
||||
else {
|
||||
// Polls MySQL statistics from script via SNMP
|
||||
@@ -11,8 +13,6 @@ else {
|
||||
$mysql = shell_exec($mysql_cmd);
|
||||
}
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
|
||||
|
||||
echo ' mysql';
|
||||
|
||||
$data = explode("\n", $mysql);
|
||||
@@ -108,108 +108,98 @@ $mapping = array(
|
||||
'CUMi' => 'c9',
|
||||
);
|
||||
|
||||
$values = array();
|
||||
unset($fields);
|
||||
foreach ($mapping as $k => $v) {
|
||||
$fields[$k] = isset($map[$v]) ? $map[$v] : (-1);
|
||||
}
|
||||
|
||||
$string = implode(':', $values);
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:IDBLBSe:GAUGE:600:0:125000000000',
|
||||
'DS:IBLFh:DERIVE:600:0:125000000000',
|
||||
'DS:IBLWn:DERIVE:600:0:125000000000',
|
||||
'DS:SRows:DERIVE:600:0:125000000000',
|
||||
'DS:SRange:DERIVE:600:0:125000000000',
|
||||
'DS:SMPs:DERIVE:600:0:125000000000',
|
||||
'DS:SScan:DERIVE:600:0:125000000000',
|
||||
'DS:IBIRd:DERIVE:600:0:125000000000',
|
||||
'DS:IBIWr:DERIVE:600:0:125000000000',
|
||||
'DS:IBILg:DERIVE:600:0:125000000000',
|
||||
'DS:IBIFSc:DERIVE:600:0:125000000000',
|
||||
'DS:IDBRDd:DERIVE:600:0:125000000000',
|
||||
'DS:IDBRId:DERIVE:600:0:125000000000',
|
||||
'DS:IDBRRd:DERIVE:600:0:125000000000',
|
||||
'DS:IDBRUd:DERIVE:600:0:125000000000',
|
||||
'DS:IBRd:DERIVE:600:0:125000000000',
|
||||
'DS:IBCd:DERIVE:600:0:125000000000',
|
||||
'DS:IBWr:DERIVE:600:0:125000000000',
|
||||
'DS:TLIe:DERIVE:600:0:125000000000',
|
||||
'DS:TLWd:DERIVE:600:0:125000000000',
|
||||
'DS:IBPse:GAUGE:600:0:125000000000',
|
||||
'DS:IBPDBp:GAUGE:600:0:125000000000',
|
||||
'DS:IBPFe:GAUGE:600:0:125000000000',
|
||||
'DS:IBPMps:GAUGE:600:0:125000000000',
|
||||
'DS:TOC:GAUGE:600:0:125000000000',
|
||||
'DS:OFs:GAUGE:600:0:125000000000',
|
||||
'DS:OTs:GAUGE:600:0:125000000000',
|
||||
'DS:OdTs:COUNTER:600:0:125000000000',
|
||||
'DS:IBSRs:DERIVE:600:0:125000000000',
|
||||
'DS:IBSWs:DERIVE:600:0:125000000000',
|
||||
'DS:IBOWs:DERIVE:600:0:125000000000',
|
||||
'DS:QCs:GAUGE:600:0:125000000000',
|
||||
'DS:QCeFy:GAUGE:600:0:125000000000',
|
||||
'DS:MaCs:GAUGE:600:0:125000000000',
|
||||
'DS:MUCs:GAUGE:600:0:125000000000',
|
||||
'DS:ACs:DERIVE:600:0:125000000000',
|
||||
'DS:AdCs:DERIVE:600:0:125000000000',
|
||||
'DS:TCd:GAUGE:600:0:125000000000',
|
||||
'DS:Cs:DERIVE:600:0:125000000000',
|
||||
'DS:IBTNx:DERIVE:600:0:125000000000',
|
||||
'DS:KRRs:DERIVE:600:0:125000000000',
|
||||
'DS:KRs:DERIVE:600:0:125000000000',
|
||||
'DS:KWR:DERIVE:600:0:125000000000',
|
||||
'DS:KWs:DERIVE:600:0:125000000000',
|
||||
'DS:QCQICe:DERIVE:600:0:125000000000',
|
||||
'DS:QCHs:DERIVE:600:0:125000000000',
|
||||
'DS:QCIs:DERIVE:600:0:125000000000',
|
||||
'DS:QCNCd:DERIVE:600:0:125000000000',
|
||||
'DS:QCLMPs:DERIVE:600:0:125000000000',
|
||||
'DS:CTMPDTs:DERIVE:600:0:125000000000',
|
||||
'DS:CTMPTs:DERIVE:600:0:125000000000',
|
||||
'DS:CTMPFs:DERIVE:600:0:125000000000',
|
||||
'DS:IBIIs:DERIVE:600:0:125000000000',
|
||||
'DS:IBIMRd:DERIVE:600:0:125000000000',
|
||||
'DS:IBIMs:DERIVE:600:0:125000000000',
|
||||
'DS:IBILog:DERIVE:602:0:125000000000',
|
||||
'DS:IBISc:DERIVE:602:0:125000000000',
|
||||
'DS:IBIFLg:DERIVE:600:0:125000000000',
|
||||
'DS:IBFBl:DERIVE:600:0:125000000000',
|
||||
'DS:IBIIAo:DERIVE:600:0:125000000000',
|
||||
'DS:IBIAd:DERIVE:600:0:125000000000',
|
||||
'DS:IBIAe:DERIVE:600:0:125000000000',
|
||||
'DS:SFJn:DERIVE:600:0:125000000000',
|
||||
'DS:SFRJn:DERIVE:600:0:125000000000',
|
||||
'DS:SRe:DERIVE:600:0:125000000000',
|
||||
'DS:SRCk:DERIVE:600:0:125000000000',
|
||||
'DS:SSn:DERIVE:600:0:125000000000',
|
||||
'DS:SQs:DERIVE:600:0:125000000000',
|
||||
'DS:BRd:DERIVE:600:0:125000000000',
|
||||
'DS:BSt:DERIVE:600:0:125000000000',
|
||||
'DS:CDe:DERIVE:600:0:125000000000',
|
||||
'DS:CIt:DERIVE:600:0:125000000000',
|
||||
'DS:CISt:DERIVE:600:0:125000000000',
|
||||
'DS:CLd:DERIVE:600:0:125000000000',
|
||||
'DS:CRe:DERIVE:600:0:125000000000',
|
||||
'DS:CRSt:DERIVE:600:0:125000000000',
|
||||
'DS:CSt:DERIVE:600:0:125000000000',
|
||||
'DS:CUe:DERIVE:600:0:125000000000',
|
||||
'DS:CUMi:DERIVE:600:0:125000000000'
|
||||
);
|
||||
|
||||
if (!is_file($mysql_rrd)) {
|
||||
rrdtool_create(
|
||||
$mysql_rrd,
|
||||
'--step 300
|
||||
DS:IDBLBSe:GAUGE:600:0:125000000000
|
||||
DS:IBLFh:DERIVE:600:0:125000000000
|
||||
DS:IBLWn:DERIVE:600:0:125000000000
|
||||
DS:SRows:DERIVE:600:0:125000000000
|
||||
DS:SRange:DERIVE:600:0:125000000000
|
||||
DS:SMPs:DERIVE:600:0:125000000000
|
||||
DS:SScan:DERIVE:600:0:125000000000
|
||||
DS:IBIRd:DERIVE:600:0:125000000000
|
||||
DS:IBIWr:DERIVE:600:0:125000000000
|
||||
DS:IBILg:DERIVE:600:0:125000000000
|
||||
DS:IBIFSc:DERIVE:600:0:125000000000
|
||||
DS:IDBRDd:DERIVE:600:0:125000000000
|
||||
DS:IDBRId:DERIVE:600:0:125000000000
|
||||
DS:IDBRRd:DERIVE:600:0:125000000000
|
||||
DS:IDBRUd:DERIVE:600:0:125000000000
|
||||
DS:IBRd:DERIVE:600:0:125000000000
|
||||
DS:IBCd:DERIVE:600:0:125000000000
|
||||
DS:IBWr:DERIVE:600:0:125000000000
|
||||
DS:TLIe:DERIVE:600:0:125000000000
|
||||
DS:TLWd:DERIVE:600:0:125000000000
|
||||
DS:IBPse:GAUGE:600:0:125000000000
|
||||
DS:IBPDBp:GAUGE:600:0:125000000000
|
||||
DS:IBPFe:GAUGE:600:0:125000000000
|
||||
DS:IBPMps:GAUGE:600:0:125000000000
|
||||
DS:TOC:GAUGE:600:0:125000000000
|
||||
DS:OFs:GAUGE:600:0:125000000000
|
||||
DS:OTs:GAUGE:600:0:125000000000
|
||||
DS:OdTs:COUNTER:600:0:125000000000
|
||||
DS:IBSRs:DERIVE:600:0:125000000000
|
||||
DS:IBSWs:DERIVE:600:0:125000000000
|
||||
DS:IBOWs:DERIVE:600:0:125000000000
|
||||
DS:QCs:GAUGE:600:0:125000000000
|
||||
DS:QCeFy:GAUGE:600:0:125000000000
|
||||
DS:MaCs:GAUGE:600:0:125000000000
|
||||
DS:MUCs:GAUGE:600:0:125000000000
|
||||
DS:ACs:DERIVE:600:0:125000000000
|
||||
DS:AdCs:DERIVE:600:0:125000000000
|
||||
DS:TCd:GAUGE:600:0:125000000000
|
||||
DS:Cs:DERIVE:600:0:125000000000
|
||||
DS:IBTNx:DERIVE:600:0:125000000000
|
||||
DS:KRRs:DERIVE:600:0:125000000000
|
||||
DS:KRs:DERIVE:600:0:125000000000
|
||||
DS:KWR:DERIVE:600:0:125000000000
|
||||
DS:KWs:DERIVE:600:0:125000000000
|
||||
DS:QCQICe:DERIVE:600:0:125000000000
|
||||
DS:QCHs:DERIVE:600:0:125000000000
|
||||
DS:QCIs:DERIVE:600:0:125000000000
|
||||
DS:QCNCd:DERIVE:600:0:125000000000
|
||||
DS:QCLMPs:DERIVE:600:0:125000000000
|
||||
DS:CTMPDTs:DERIVE:600:0:125000000000
|
||||
DS:CTMPTs:DERIVE:600:0:125000000000
|
||||
DS:CTMPFs:DERIVE:600:0:125000000000
|
||||
DS:IBIIs:DERIVE:600:0:125000000000
|
||||
DS:IBIMRd:DERIVE:600:0:125000000000
|
||||
DS:IBIMs:DERIVE:600:0:125000000000
|
||||
DS:IBILog:DERIVE:602:0:125000000000
|
||||
DS:IBISc:DERIVE:602:0:125000000000
|
||||
DS:IBIFLg:DERIVE:600:0:125000000000
|
||||
DS:IBFBl:DERIVE:600:0:125000000000
|
||||
DS:IBIIAo:DERIVE:600:0:125000000000
|
||||
DS:IBIAd:DERIVE:600:0:125000000000
|
||||
DS:IBIAe:DERIVE:600:0:125000000000
|
||||
DS:SFJn:DERIVE:600:0:125000000000
|
||||
DS:SFRJn:DERIVE:600:0:125000000000
|
||||
DS:SRe:DERIVE:600:0:125000000000
|
||||
DS:SRCk:DERIVE:600:0:125000000000
|
||||
DS:SSn:DERIVE:600:0:125000000000
|
||||
DS:SQs:DERIVE:600:0:125000000000
|
||||
DS:BRd:DERIVE:600:0:125000000000
|
||||
DS:BSt:DERIVE:600:0:125000000000
|
||||
DS:CDe:DERIVE:600:0:125000000000
|
||||
DS:CIt:DERIVE:600:0:125000000000
|
||||
DS:CISt:DERIVE:600:0:125000000000
|
||||
DS:CLd:DERIVE:600:0:125000000000
|
||||
DS:CRe:DERIVE:600:0:125000000000
|
||||
DS:CRSt:DERIVE:600:0:125000000000
|
||||
DS:CSt:DERIVE:600:0:125000000000
|
||||
DS:CUe:DERIVE:600:0:125000000000
|
||||
DS:CUMi:DERIVE:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}//end if
|
||||
|
||||
rrdtool_update($mysql_rrd, $fields);
|
||||
|
||||
$tags = array('name' => 'mysql', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
// Process state statistics
|
||||
$mysql_status_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'-status.rrd';
|
||||
|
||||
$mapping_status = array(
|
||||
'State_closing_tables' => 'd2',
|
||||
'State_copying_to_tmp_table' => 'd3',
|
||||
@@ -229,22 +219,14 @@ $mapping_status = array(
|
||||
'State_other' => 'dh',
|
||||
);
|
||||
|
||||
$values = array();
|
||||
$rrd_create = '';
|
||||
$rrd_name = array('app', $name, $app_id, 'status');
|
||||
$rrd_def = array();
|
||||
unset($fields);
|
||||
foreach ($mapping_status as $desc => $id) {
|
||||
$fields[$desc] = isset($map[$id]) ? $map[$id] : (-1);
|
||||
$rrd_create .= ' DS:'.$id.':GAUGE:600:0:125000000000';
|
||||
$fields[$desc] = isset($map[$id]) ? $map[$id] : (-1);
|
||||
$rrd_def[] = 'DS:'.$id.':GAUGE:600:0:125000000000';
|
||||
}
|
||||
|
||||
$string = implode(':', $values);
|
||||
|
||||
if (!is_file($mysql_status_rrd)) {
|
||||
rrdtool_create($mysql_status_rrd, '--step 300 '.$rrd_create.' '.$config['rrd_rra']);
|
||||
}
|
||||
|
||||
rrdtool_update($mysql_status_rrd, $fields);
|
||||
|
||||
$tags = array('name' => 'mysql', 'app_id' => $app['app_id'], 'status' => true);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$status = true;
|
||||
$tags = compact('name', 'app_id', 'status', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
|
||||
@@ -1,48 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (!empty($agent_data['app']['nginx'])) {
|
||||
$nginx = $agent_data['app']['nginx'];
|
||||
$name = 'nginx';
|
||||
$app_id = $app['app_id'];
|
||||
if (!empty($agent_data['app'][$name])) {
|
||||
$nginx = $agent_data['app'][$name];
|
||||
}
|
||||
else {
|
||||
// Polls nginx statistics from script via SNMP
|
||||
$nginx = snmp_get($device, 'nsExtendOutputFull.5.110.103.105.110.120', '-Ovq', 'NET-SNMP-EXTEND-MIB');
|
||||
}
|
||||
|
||||
$nginx_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-nginx-'.$app['app_id'].'.rrd';
|
||||
|
||||
echo ' nginx';
|
||||
|
||||
list($active, $reading, $writing, $waiting, $req) = explode("\n", $nginx);
|
||||
if (!is_file($nginx_rrd)) {
|
||||
rrdtool_create(
|
||||
$nginx_rrd,
|
||||
'--step 300
|
||||
DS:Requests:DERIVE:600:0:125000000000
|
||||
DS:Active:GAUGE:600:0:125000000000
|
||||
DS:Reading:GAUGE:600:0:125000000000
|
||||
DS:Writing:GAUGE:600:0:125000000000
|
||||
DS:Waiting:GAUGE:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
|
||||
d_echo("active: $active reading: $reading writing: $writing waiting: $waiting Requests: $req");
|
||||
$fields = array(
|
||||
'Requests' => $req,
|
||||
'Active' => $active,
|
||||
'Reading' => $reading,
|
||||
'Writing' => $writing,
|
||||
'Waiting' => $waiting,
|
||||
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:Requests:DERIVE:600:0:125000000000',
|
||||
'DS:Active:GAUGE:600:0:125000000000',
|
||||
'DS:Reading:GAUGE:600:0:125000000000',
|
||||
'DS:Writing:GAUGE:600:0:125000000000',
|
||||
'DS:Waiting:GAUGE:600:0:125000000000'
|
||||
);
|
||||
|
||||
rrdtool_update($nginx_rrd, $fields);
|
||||
$fields = array(
|
||||
'Requests' => $req,
|
||||
'Active' => $active,
|
||||
'Reading' => $reading,
|
||||
'Writing' => $writing,
|
||||
'Waiting' => $waiting,
|
||||
);
|
||||
|
||||
$tags = array('name' => 'nginx', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
// Unset the variables we set here
|
||||
unset($nginx);
|
||||
unset($nginx_rrd);
|
||||
unset($active);
|
||||
unset($reading);
|
||||
unset($writing);
|
||||
unset($req);
|
||||
unset($nginx, $active, $reading, $writing, $req, $rrd_name, $rrd_def, $tags);
|
||||
|
||||
@@ -1,38 +1,33 @@
|
||||
<?php
|
||||
|
||||
// Polls ntp-client statistics from script via SNMP
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpclient-'.$app['app_id'].'.rrd';
|
||||
$options = '-O qv';
|
||||
$oid = 'nsExtendOutputFull.9.110.116.112.99.108.105.101.110.116';
|
||||
|
||||
$ntpclient = snmp_get($device, $oid, $options);
|
||||
|
||||
$name = 'ntpclient';
|
||||
$app_id = $app['app_id'];
|
||||
echo ' ntp-client';
|
||||
|
||||
list ($offset, $frequency, $jitter, $noise, $stability) = explode("\n", $ntpclient);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:offset:GAUGE:600:-1000:1000
|
||||
DS:frequency:GAUGE:600:-1000:1000
|
||||
DS:jitter:GAUGE:600:-1000:1000
|
||||
DS:noise:GAUGE:600:-1000:1000
|
||||
DS:stability:GAUGE:600:-1000:1000 '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
|
||||
$fields = array(
|
||||
'offset' => $offset,
|
||||
'frequency' => $frequency,
|
||||
'jitter' => $jitter,
|
||||
'noise' => $noise,
|
||||
'stability' => $stability,
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:offset:GAUGE:600:-1000:1000',
|
||||
'DS:frequency:GAUGE:600:-1000:1000',
|
||||
'DS:jitter:GAUGE:600:-1000:1000',
|
||||
'DS:noise:GAUGE:600:-1000:1000',
|
||||
'DS:stability:GAUGE:600:-1000:1000'
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
$fields = array(
|
||||
'offset' => $offset,
|
||||
'frequency' => $frequency,
|
||||
'jitter' => $jitter,
|
||||
'noise' => $noise,
|
||||
'stability' => $stability,
|
||||
);
|
||||
|
||||
$tags = array('name' => 'ntpclient', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?php
|
||||
|
||||
// Polls ntpd-server statistics from script via SNMP
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
|
||||
$name = 'ntpdserver';
|
||||
$app_id = $app['app_id'];
|
||||
|
||||
$options = '-O qv';
|
||||
$oid = 'nsExtendOutputFull.10.110.116.112.100.115.101.114.118.101.114';
|
||||
$mib = 'NET-SNMP-EXTEND-MIB';
|
||||
|
||||
$ntpdserver = snmp_get($device, $oid, $options, $mib);
|
||||
|
||||
echo ' ntpd-server';
|
||||
@@ -14,26 +15,23 @@ list ($stratum, $offset, $frequency, $jitter, $noise, $stability, $uptime,
|
||||
$buffer_recv, $buffer_free, $buffer_used, $packets_drop, $packets_ignore,
|
||||
$packets_recv, $packets_sent) = explode("\n", $ntpdserver);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:stratum:GAUGE:600:-1000:1000
|
||||
DS:offset:GAUGE:600:-1000:1000
|
||||
DS:frequency:GAUGE:600:-1000:1000
|
||||
DS:jitter:GAUGE:600:-1000:1000
|
||||
DS:noise:GAUGE:600:-1000:1000
|
||||
DS:stability:GAUGE:600:-1000:1000
|
||||
DS:uptime:GAUGE:600:0:125000000000
|
||||
DS:buffer_recv:GAUGE:600:0:100000
|
||||
DS:buffer_free:GAUGE:600:0:100000
|
||||
DS:buffer_used:GAUGE:600:0:100000
|
||||
DS:packets_drop:DERIVE:600:0:125000000000
|
||||
DS:packets_ignore:DERIVE:600:0:125000000000
|
||||
DS:packets_recv:DERIVE:600:0:125000000000
|
||||
DS:packets_sent:DERIVE:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:stratum:GAUGE:600:-1000:1000',
|
||||
'DS:offset:GAUGE:600:-1000:1000',
|
||||
'DS:frequency:GAUGE:600:-1000:1000',
|
||||
'DS:jitter:GAUGE:600:-1000:1000',
|
||||
'DS:noise:GAUGE:600:-1000:1000',
|
||||
'DS:stability:GAUGE:600:-1000:1000',
|
||||
'DS:uptime:GAUGE:600:0:125000000000',
|
||||
'DS:buffer_recv:GAUGE:600:0:100000',
|
||||
'DS:buffer_free:GAUGE:600:0:100000',
|
||||
'DS:buffer_used:GAUGE:600:0:100000',
|
||||
'DS:packets_drop:DERIVE:600:0:125000000000',
|
||||
'DS:packets_ignore:DERIVE:600:0:125000000000',
|
||||
'DS:packets_recv:DERIVE:600:0:125000000000',
|
||||
'DS:packets_sent:DERIVE:600:0:125000000000'
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'stratum' => $stratum,
|
||||
@@ -52,7 +50,5 @@ $fields = array(
|
||||
'packets_sent' => $packets_sent,
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
|
||||
$tags = array('name' => 'ntpdserver', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rdd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
|
||||
// Polls powerdns statistics from script via SNMP
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-powerdns-'.$app['app_id'].'.rrd';
|
||||
$options = '-O qv';
|
||||
$mib = 'NET-SNMP-EXTEND-MIB';
|
||||
$oid = 'nsExtendOutputFull.8.112.111.119.101.114.100.110.115';
|
||||
|
||||
if ($agent_data['app']['powerdns']) {
|
||||
$powerdns = $agent_data['app']['powerdns'];
|
||||
$name = 'powerdns';
|
||||
$app_id = $app['app_id'];
|
||||
if ($agent_data['app'][$name]) {
|
||||
$powerdns = $agent_data['app'][$name];
|
||||
}
|
||||
else {
|
||||
$powerdns = snmp_get($device, $oid, $options, $mib);
|
||||
@@ -21,62 +22,57 @@ list ($corrupt, $def_cacheInserts, $def_cacheLookup, $latency, $pc_hit,
|
||||
$udp_answers, $udp_queries, $udp4_answers, $udp4_queries, $udp6_answers,
|
||||
$udp6_queries) = explode("\n", $powerdns);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:corruptPackets:DERIVE:600:0:125000000000
|
||||
DS:def_cacheInserts:DERIVE:600:0:125000000000
|
||||
DS:def_cacheLookup:DERIVE:600:0:125000000000
|
||||
DS:latency:DERIVE:600:0:125000000000
|
||||
DS:pc_hit:DERIVE:600:0:125000000000
|
||||
DS:pc_miss:DERIVE:600:0:125000000000
|
||||
DS:pc_size:DERIVE:600:0:125000000000
|
||||
DS:qsize:DERIVE:600:0:125000000000
|
||||
DS:qc_hit:DERIVE:600:0:125000000000
|
||||
DS:qc_miss:DERIVE:600:0:125000000000
|
||||
DS:rec_answers:DERIVE:600:0:125000000000
|
||||
DS:rec_questions:DERIVE:600:0:125000000000
|
||||
DS:servfailPackets:DERIVE:600:0:125000000000
|
||||
DS:q_tcpAnswers:DERIVE:600:0:125000000000
|
||||
DS:q_tcpQueries:DERIVE:600:0:125000000000
|
||||
DS:q_timedout:DERIVE:600:0:125000000000
|
||||
DS:q_udpAnswers:DERIVE:600:0:125000000000
|
||||
DS:q_udpQueries:DERIVE:600:0:125000000000
|
||||
DS:q_udp4Answers:DERIVE:600:0:125000000000
|
||||
DS:q_udp4Queries:DERIVE:600:0:125000000000
|
||||
DS:q_udp6Answers:DERIVE:600:0:125000000000
|
||||
DS:q_udp6Queries:DERIVE:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}//end if
|
||||
|
||||
$fields = array(
|
||||
'corruptPackets' => $corrupt,
|
||||
'def_cacheInserts' => $def_cacheInserts,
|
||||
'def_cacheLookup' => $def_cacheLookup,
|
||||
'latency' => $latency,
|
||||
'pc_hit' => $pc_hit,
|
||||
'pc_miss' => $pc_miss,
|
||||
'pc_size' => $pc_size,
|
||||
'qsize' => $qsize,
|
||||
'qc_hit' => $qc_hit,
|
||||
'qc_miss' => $qc_miss,
|
||||
'rec_answers' => $rec_answers,
|
||||
'rec_questions' => $req_questions,
|
||||
'servfailPackets' => $servfail,
|
||||
'q_tcpAnswers' => $tcp_answers,
|
||||
'q_tcpQueries' => $tcp_queries,
|
||||
'q_timedout' => $timedout,
|
||||
'q_udpAnswers' => $udp_answers,
|
||||
'q_udpQueries' => $udp_queries,
|
||||
'q_udp4Answers' => $udp4_answers,
|
||||
'q_udp4Queries' => $udp4_queries,
|
||||
'q_udp6Answers' => $udp6_answers,
|
||||
'q_udp6Queries' => $udp6_queries,
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:corruptPackets:DERIVE:600:0:125000000000',
|
||||
'DS:def_cacheInserts:DERIVE:600:0:125000000000',
|
||||
'DS:def_cacheLookup:DERIVE:600:0:125000000000',
|
||||
'DS:latency:DERIVE:600:0:125000000000',
|
||||
'DS:pc_hit:DERIVE:600:0:125000000000',
|
||||
'DS:pc_miss:DERIVE:600:0:125000000000',
|
||||
'DS:pc_size:DERIVE:600:0:125000000000',
|
||||
'DS:qsize:DERIVE:600:0:125000000000',
|
||||
'DS:qc_hit:DERIVE:600:0:125000000000',
|
||||
'DS:qc_miss:DERIVE:600:0:125000000000',
|
||||
'DS:rec_answers:DERIVE:600:0:125000000000',
|
||||
'DS:rec_questions:DERIVE:600:0:125000000000',
|
||||
'DS:servfailPackets:DERIVE:600:0:125000000000',
|
||||
'DS:q_tcpAnswers:DERIVE:600:0:125000000000',
|
||||
'DS:q_tcpQueries:DERIVE:600:0:125000000000',
|
||||
'DS:q_timedout:DERIVE:600:0:125000000000',
|
||||
'DS:q_udpAnswers:DERIVE:600:0:125000000000',
|
||||
'DS:q_udpQueries:DERIVE:600:0:125000000000',
|
||||
'DS:q_udp4Answers:DERIVE:600:0:125000000000',
|
||||
'DS:q_udp4Queries:DERIVE:600:0:125000000000',
|
||||
'DS:q_udp6Answers:DERIVE:600:0:125000000000',
|
||||
'DS:q_udp6Queries:DERIVE:600:0:125000000000'
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
$fields = array(
|
||||
'corruptPackets' => $corrupt,
|
||||
'def_cacheInserts' => $def_cacheInserts,
|
||||
'def_cacheLookup' => $def_cacheLookup,
|
||||
'latency' => $latency,
|
||||
'pc_hit' => $pc_hit,
|
||||
'pc_miss' => $pc_miss,
|
||||
'pc_size' => $pc_size,
|
||||
'qsize' => $qsize,
|
||||
'qc_hit' => $qc_hit,
|
||||
'qc_miss' => $qc_miss,
|
||||
'rec_answers' => $rec_answers,
|
||||
'rec_questions' => $req_questions,
|
||||
'servfailPackets' => $servfail,
|
||||
'q_tcpAnswers' => $tcp_answers,
|
||||
'q_tcpQueries' => $tcp_queries,
|
||||
'q_timedout' => $timedout,
|
||||
'q_udpAnswers' => $udp_answers,
|
||||
'q_udpQueries' => $udp_queries,
|
||||
'q_udp4Answers' => $udp4_answers,
|
||||
'q_udp4Queries' => $udp4_queries,
|
||||
'q_udp6Answers' => $udp6_answers,
|
||||
'q_udp6Queries' => $udp6_queries,
|
||||
);
|
||||
|
||||
$tags = array('name' => 'powerdns', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (isset($config['enable_proxmox']) && $config['enable_proxmox'] && !empty($agent_data['app']['proxmox'])) {
|
||||
$proxmox = $agent_data['app']['proxmox'];
|
||||
$name = 'proxmox';
|
||||
$app_id = $app['app_id'];
|
||||
if (isset($config['enable_proxmox']) && $config['enable_proxmox'] && !empty($agent_data['app'][$name])) {
|
||||
$proxmox = $agent_data['app'][$name];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,39 +45,38 @@ $pmxlines = explode("\n", $proxmox);
|
||||
|
||||
$pmxcluster = array_shift($pmxlines);
|
||||
|
||||
$pmxcdir = join('/', array($config['rrd_dir'],'proxmox',$pmxcluster));
|
||||
$pmxcdir = join('/', array($config['rrd_dir'], $name, $pmxcluster));
|
||||
if (!is_dir($pmxcdir)) {
|
||||
mkdir($pmxcdir, 0775, true);
|
||||
}
|
||||
|
||||
dbUpdate(array('device_id' => $device['device_id'], 'app_type' => 'proxmox', 'app_instance' => $pmxcluster), 'applications', '`device_id` = ? AND `app_type` = ?', array($device['device_id'], 'proxmox'));
|
||||
dbUpdate(array('device_id' => $device['device_id'], 'app_type' => $name, 'app_instance' => $pmxcluster), 'applications', '`device_id` = ? AND `app_type` = ?', array($device['device_id'], $name));
|
||||
|
||||
if (count($pmxlines) > 0) {
|
||||
$pmxcache = [];
|
||||
|
||||
foreach ($pmxlines as $vm) {
|
||||
list($vmid, $vmport, $vmpin, $vmpout, $vmdesc) = explode('/', $vm, 5);
|
||||
|
||||
$rrd_filename = join('/', array(
|
||||
$pmxcdir,
|
||||
$vmid.'_netif_'.$vmport.'.rrd'));
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
' --step 300
|
||||
DS:INOCTETS:DERIVE:600:0:12500000000
|
||||
DS:OUTOCTETS:DERIVE:600:0:12500000000 '.$config['rrd_rra']);
|
||||
}
|
||||
|
||||
rrdtool_update($rrd_filename, array("INOCTETS" => $vmpin, "OUTOCTETS" => $vmpout));
|
||||
print "Proxmox ($pmxcluster): $vmdesc: $vmpin/$vmpout/$vmport\n";
|
||||
|
||||
$rrd_name = join('/', array($name, $pmxcluster, $vmid)).'_netif_'.$vmport;
|
||||
$rrd_def = array(
|
||||
'DS:INOCTETS:DERIVE:600:0:12500000000',
|
||||
'DS:OUTOCTETS:DERIVE:600:0:12500000000'
|
||||
);
|
||||
$fields = array(
|
||||
'INOCTETS' => $vmpin,
|
||||
'OUTOCTETS' => $vmpout
|
||||
);
|
||||
|
||||
$tags = compact('name', 'app_id', 'pmxcluster', 'vmid', 'vmport', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
if (proxmox_vm_exists($vmid, $pmxcluster, $pmxcache) === true) {
|
||||
dbUpdate(array('device_id' => $device['device_id'], 'last_seen' => array('NOW()'), 'description' => $vmdesc), 'proxmox', '`vmid` = ? AND `cluster` = ?', array($vmid, $pmxcluster));
|
||||
dbUpdate(array('device_id' => $device['device_id'], 'last_seen' => array('NOW()'), 'description' => $vmdesc), $name, '`vmid` = ? AND `cluster` = ?', array($vmid, $pmxcluster));
|
||||
}
|
||||
else {
|
||||
$pmxcache[$pmxcluster][$vmid] = dbInsert(array('cluster' => $pmxcluster, 'vmid' => $vmid, 'description' => $vmdesc, 'device_id' => $device['device_id']), 'proxmox');
|
||||
$pmxcache[$pmxcluster][$vmid] = dbInsert(array('cluster' => $pmxcluster, 'vmid' => $vmid, 'description' => $vmdesc, 'device_id' => $device['device_id']), $name);
|
||||
}
|
||||
|
||||
if ($portid = proxmox_port_exists($vmid, $pmxcluster, $vmport) !== false) {
|
||||
|
||||
@@ -28,9 +28,11 @@
|
||||
echo ' rrdcached';
|
||||
|
||||
$data = "";
|
||||
$name = 'rrdcached';
|
||||
$app_id = $app['app_id'];
|
||||
|
||||
if ($agent_data['app']['rrdcached']) {
|
||||
$data = $agent_data['app']['rrdcached'];
|
||||
if ($agent_data['app'][$name]) {
|
||||
$data = $agent_data['app'][$name];
|
||||
} else {
|
||||
d_echo("\nNo Agent Data. Attempting to connect directly to the rrdcached server " . $device['hostname'] . ":42217\n");
|
||||
|
||||
@@ -63,40 +65,30 @@ if ($agent_data['app']['rrdcached']) {
|
||||
}
|
||||
}
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-rrdcached-'.$app['app_id'].'.rrd';
|
||||
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:queue_length:GAUGE:600:0:U',
|
||||
'DS:updates_received:COUNTER:600:0:U',
|
||||
'DS:flushes_received:COUNTER:600:0:U',
|
||||
'DS:updates_written:COUNTER:600:0:U',
|
||||
'DS:data_sets_written:COUNTER:600:0:U',
|
||||
'DS:tree_nodes_number:GAUGE:600:0:U',
|
||||
'DS:tree_depth:GAUGE:600:0:U',
|
||||
'DS:journal_bytes:COUNTER:600:0:U',
|
||||
'DS:journal_rotate:COUNTER:600:0:U'
|
||||
);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:queue_length:GAUGE:600:0:U
|
||||
DS:updates_received:COUNTER:600:0:U
|
||||
DS:flushes_received:COUNTER:600:0:U
|
||||
DS:updates_written:COUNTER:600:0:U
|
||||
DS:data_sets_written:COUNTER:600:0:U
|
||||
DS:tree_nodes_number:GAUGE:600:0:U
|
||||
DS:tree_depth:GAUGE:600:0:U
|
||||
DS:journal_bytes:COUNTER:600:0:U
|
||||
DS:journal_rotate:COUNTER:600:0:U
|
||||
'.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
$fields = array();
|
||||
foreach (explode("\n", $data) as $line) {
|
||||
$split = explode(': ', $line);
|
||||
if (count($split) == 2) {
|
||||
$name = strtolower(preg_replace('/[A-Z]/', '_$0', lcfirst($split[0])));
|
||||
$fields[$name] = $split[1];
|
||||
$ds = strtolower(preg_replace('/[A-Z]/', '_$0', lcfirst($split[0])));
|
||||
$fields[$ds] = $split[1];
|
||||
}
|
||||
}
|
||||
|
||||
rrdtool_update($rrd_filename, $fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
$tags = array('name' => 'rrdcached', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
|
||||
unset($data);
|
||||
unset($rrd_filename);
|
||||
unset($fields);
|
||||
unset($tags);
|
||||
unset($data, $rrd_name, $rrd_def, $fields, $tags);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<?php
|
||||
|
||||
// Polls shoutcast statistics from script via SNMP
|
||||
$name = 'shoutcast';
|
||||
$app_id = $app['app_id'];
|
||||
|
||||
$options = '-O qv';
|
||||
$oid = 'nsExtendOutputFull.9.115.104.111.117.116.99.97.115.116';
|
||||
|
||||
$shoutcast = snmp_get($device, $oid, $options);
|
||||
|
||||
echo ' shoutcast';
|
||||
@@ -14,48 +16,34 @@ foreach ($servers as $item => $server) {
|
||||
$server = trim($server);
|
||||
|
||||
if (!empty($server)) {
|
||||
$data = explode(';', $server);
|
||||
$data = explode(';', $server);
|
||||
list($host, $port) = explode(':', $data['0'], 2);
|
||||
$bitrate = $data['1'];
|
||||
$traf_in = $data['2'];
|
||||
$traf_out = $data['3'];
|
||||
$current = $data['4'];
|
||||
$status = $data['5'];
|
||||
$peak = $data['6'];
|
||||
$max = $data['7'];
|
||||
$unique = $data['8'];
|
||||
$rrdfile = $config['rrd_dir'].'/'.$device['hostname'].'/app-shoutcast-'.$app['app_id'].'-'.$host.'_'.$port.'.rrd';
|
||||
|
||||
if (!is_file($rrdfile)) {
|
||||
rrdtool_create(
|
||||
$rrdfile,
|
||||
'--step 300
|
||||
DS:bitrate:GAUGE:600:0:125000000000
|
||||
DS:traf_in:GAUGE:600:0:125000000000
|
||||
DS:traf_out:GAUGE:600:0:125000000000
|
||||
DS:current:GAUGE:600:0:125000000000
|
||||
DS:status:GAUGE:600:0:125000000000
|
||||
DS:peak:GAUGE:600:0:125000000000
|
||||
DS:max:GAUGE:600:0:125000000000
|
||||
DS:unique:GAUGE:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}
|
||||
|
||||
$fields = array(
|
||||
'bitrate' => $bitrate,
|
||||
'traf_in' => $traf_in,
|
||||
'traf_out' => $traf_out,
|
||||
'current' => $current,
|
||||
'status' => $status,
|
||||
'peak' => $peak,
|
||||
'max' => $max,
|
||||
'unique' => $unique,
|
||||
$rrd_name = array('app', $name, $app_id, $host . '_' . $port);
|
||||
$rrd_def = array(
|
||||
'DS:bitrate:GAUGE:600:0:125000000000',
|
||||
'DS:traf_in:GAUGE:600:0:125000000000',
|
||||
'DS:traf_out:GAUGE:600:0:125000000000',
|
||||
'DS:current:GAUGE:600:0:125000000000',
|
||||
'DS:status:GAUGE:600:0:125000000000',
|
||||
'DS:peak:GAUGE:600:0:125000000000',
|
||||
'DS:max:GAUGE:600:0:125000000000',
|
||||
'DS:unique:GAUGE:600:0:125000000000'
|
||||
);
|
||||
|
||||
rrdtool_update($rrdfile, $fields);
|
||||
$fields = array(
|
||||
'bitrate' => $data['1'],
|
||||
'traf_in' => $data['2'],
|
||||
'traf_out' => $data['3'],
|
||||
'current' => $data['4'],
|
||||
'status' => $data['5'],
|
||||
'peak' => $data['6'],
|
||||
'max' => $data['7'],
|
||||
'unique' => $data['8'],
|
||||
);
|
||||
|
||||
$tags = array('name' => 'shoutcast', 'app_id' => $app['app_id'], 'host' => $host, 'port' => $port);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'host', 'port', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
}//end if
|
||||
}//end foreach
|
||||
|
||||
@@ -24,39 +24,35 @@
|
||||
* @subpackage Polling
|
||||
*/
|
||||
|
||||
if (!empty($agent_data['app']['tinydns']) && $app['app_id'] > 0) {
|
||||
$name = 'tinydns';
|
||||
$app_id = $app['app_id'];
|
||||
if (!empty($agent_data['app'][$name]) && $app_id > 0) {
|
||||
echo ' tinydns';
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-tinydns-'.$app['app_id'].'.rrd';
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create(
|
||||
$rrd_filename,
|
||||
'--step 300
|
||||
DS:a:COUNTER:600:0:125000000000
|
||||
DS:ns:COUNTER:600:0:125000000000
|
||||
DS:cname:COUNTER:600:0:125000000000
|
||||
DS:soa:COUNTER:600:0:125000000000
|
||||
DS:ptr:COUNTER:600:0:125000000000
|
||||
DS:hinfo:COUNTER:600:0:125000000000
|
||||
DS:mx:COUNTER:600:0:125000000000
|
||||
DS:txt:COUNTER:600:0:125000000000
|
||||
DS:rp:COUNTER:600:0:125000000000
|
||||
DS:sig:COUNTER:600:0:125000000000
|
||||
DS:key:COUNTER:600:0:125000000000
|
||||
DS:aaaa:COUNTER:600:0:125000000000
|
||||
DS:axfr:COUNTER:600:0:125000000000
|
||||
DS:any:COUNTER:600:0:125000000000
|
||||
DS:total:COUNTER:600:0:125000000000
|
||||
DS:other:COUNTER:600:0:125000000000
|
||||
DS:notauth:COUNTER:600:0:125000000000
|
||||
DS:notimpl:COUNTER:600:0:125000000000
|
||||
DS:badclass:COUNTER:600:0:125000000000
|
||||
DS:noquery:COUNTER:600:0:125000000000 '.$config['rrd_rra']
|
||||
);
|
||||
}//end if
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:a:COUNTER:600:0:125000000000',
|
||||
'DS:ns:COUNTER:600:0:125000000000',
|
||||
'DS:cname:COUNTER:600:0:125000000000',
|
||||
'DS:soa:COUNTER:600:0:125000000000',
|
||||
'DS:ptr:COUNTER:600:0:125000000000',
|
||||
'DS:hinfo:COUNTER:600:0:125000000000',
|
||||
'DS:mx:COUNTER:600:0:125000000000',
|
||||
'DS:txt:COUNTER:600:0:125000000000',
|
||||
'DS:rp:COUNTER:600:0:125000000000',
|
||||
'DS:sig:COUNTER:600:0:125000000000',
|
||||
'DS:key:COUNTER:600:0:125000000000',
|
||||
'DS:aaaa:COUNTER:600:0:125000000000',
|
||||
'DS:axfr:COUNTER:600:0:125000000000',
|
||||
'DS:any:COUNTER:600:0:125000000000',
|
||||
'DS:total:COUNTER:600:0:125000000000',
|
||||
'DS:other:COUNTER:600:0:125000000000',
|
||||
'DS:notauth:COUNTER:600:0:125000000000',
|
||||
'DS:notimpl:COUNTER:600:0:125000000000',
|
||||
'DS:badclass:COUNTER:600:0:125000000000',
|
||||
'DS:noquery:COUNTER:600:0:125000000000'
|
||||
);
|
||||
|
||||
rrdtool_update($rrd_filename, 'N:'.$agent_data['app']['tinydns']);
|
||||
|
||||
$tags = array('name' => 'tinydns', 'app_id' => $app['app_id']);
|
||||
influx_update($device,'app',$tags,$fields);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
}//end if
|
||||
|
||||
Reference in New Issue
Block a user