mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: Added functionality to support recording status info (#6628)
* feature: Added functionality to support recording status info * updated phpdoc block
This commit is contained in:
committed by
Tony Murray
parent
0338734fe7
commit
1ce58cd33d
@@ -11,7 +11,7 @@ $rrd_name = array('app', $name, $app_id);
|
|||||||
$rrd_def = RrdDefinition::make()->addDataset('packages', 'GAUGE', 0);
|
$rrd_def = RrdDefinition::make()->addDataset('packages', 'GAUGE', 0);
|
||||||
|
|
||||||
$osupdates = snmp_get($device, $oid, $options, $mib);
|
$osupdates = snmp_get($device, $oid, $options, $mib);
|
||||||
update_application($app, $osupdates);
|
update_application($app, $osupdates, $osupdates);
|
||||||
|
|
||||||
$fields = array('packages' => $osupdates,);
|
$fields = array('packages' => $osupdates,);
|
||||||
|
|
||||||
|
@@ -548,8 +548,9 @@ function location_to_latlng($device)
|
|||||||
*
|
*
|
||||||
* @param array $app app from the db, including app_id
|
* @param array $app app from the db, including app_id
|
||||||
* @param string $response This should be the full output
|
* @param string $response This should be the full output
|
||||||
|
* @param string $current This is the current value we store in rrd for graphing
|
||||||
*/
|
*/
|
||||||
function update_application($app, $response)
|
function update_application($app, $response, $current = '')
|
||||||
{
|
{
|
||||||
if (!is_numeric($app['app_id'])) {
|
if (!is_numeric($app['app_id'])) {
|
||||||
d_echo('$app does not contain app_id, could not update');
|
d_echo('$app does not contain app_id, could not update');
|
||||||
@@ -557,8 +558,9 @@ function update_application($app, $response)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'app_state' => 'UNKNOWN',
|
'app_state' => 'UNKNOWN',
|
||||||
'timestamp' => array('NOW()'),
|
'app_status' => $current,
|
||||||
|
'timestamp' => array('NOW()'),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($response != '' && $response !== false) {
|
if ($response != '' && $response !== false) {
|
||||||
|
Reference in New Issue
Block a user