mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
WebUI: Oxidized Device List: Link to config and refreshDevice Btn (#9129)
* WebUI: Direct link to oxidized config from list, oxidized refresh device capability * WebUI: Direct link to oxidized config from list, oxidized refresh device capability * Move oxidized_node_update in functions.php to avoid code duplication * Update refresh-oxidized-node.inc.php * Update functions.php
This commit is contained in:
@@ -2628,3 +2628,26 @@ function is_disk_valid($disk, $device)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Queues a hostname to be refreshed by Oxidized
|
||||
* Settings: oxidized.url
|
||||
*
|
||||
* @param string $hostname
|
||||
* @param string $msg
|
||||
* @param string $username
|
||||
* @return bool
|
||||
*/
|
||||
function oxidized_node_update($hostname, $msg, $username = 'not_provided')
|
||||
{
|
||||
// Work around https://github.com/rack/rack/issues/337
|
||||
$msg = str_replace("%", "", $msg);
|
||||
$postdata = ["user" => $username, "msg" => $msg];
|
||||
$oxidized_url = Config::get('oxidized.url');
|
||||
if (!empty($oxidized_url)) {
|
||||
Requests::put("$oxidized_url/node/next/$hostname", [], json_encode($postdata), ['proxy' => get_proxy()]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}//end oxidized_node_update()
|
||||
|
||||
Reference in New Issue
Block a user