mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #4052 from florianbeer/proxmox
Add snmp polling capability for Proxmox
This commit is contained in:
@@ -14,6 +14,7 @@ Different applications support a variety of ways collect data: by direct connect
|
||||
8. [DHCP Stats](#dhcp-stats) - extend SNMP
|
||||
9. [Memcached](#memcached) - extend SNMP
|
||||
10. [Unbound](#unbound) - Agent
|
||||
11. [Proxmox](#proxmos) - extend SNMP
|
||||
|
||||
|
||||
* [Agent Setup](#agent-setup)
|
||||
@@ -186,6 +187,16 @@ server:
|
||||
|
||||
Restart your unbound after changing the configuration,v erify it is working by running /usr/lib/check_mk_agent/local/unbound.sh
|
||||
|
||||
### Proxmox
|
||||
1. Download the script onto the desired host (the host must be added to LibreNMS devices)
|
||||
`wget https://github.com/librenms/librenms-agent/blob/master/agent-local/proxmox -o /usr/local/bin/proxmox`
|
||||
2. Make the script executable: `chmod +x /usr/local/proxmox`
|
||||
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add:
|
||||
`extend proxmox /usr/local/bin/proxmox`
|
||||
(Note: if your snmpd doesn't run as root, you might have to invoke the script using sudo. `extend proxmox /usr/bin/sudo /usr/local/bin/proxmox`)
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check `Proxmox` on the Applications tab.
|
||||
|
||||
Agent Setup
|
||||
-----------
|
||||
|
||||
|
@@ -40,6 +40,15 @@ $app_id = $app['app_id'];
|
||||
|
||||
if (isset($config['enable_proxmox']) && $config['enable_proxmox'] && !empty($agent_data['app'][$name])) {
|
||||
$proxmox = $agent_data['app'][$name];
|
||||
} elseif (isset($config['enable_proxmox']) && $config['enable_proxmox']) {
|
||||
$options = '-O qv';
|
||||
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.7.112.114.111.120.109.111.120';
|
||||
$proxmox = snmp_get($device, $oid, $options);
|
||||
$proxmox = preg_replace('/^.+\n/', '', $proxmox);
|
||||
$proxmox = str_replace("<<<app-proxmox>>>\n", '', $proxmox);
|
||||
}
|
||||
|
||||
if ($proxmox) {
|
||||
$pmxlines = explode("\n", $proxmox);
|
||||
$pmxcluster = array_shift($pmxlines);
|
||||
dbUpdate(array('device_id' => $device['device_id'], 'app_type' => $name, 'app_instance' => $pmxcluster),
|
||||
|
Reference in New Issue
Block a user