support for multiple hosts in one instance
[upsgraph] / apc.conf
index 6d0c895f812fe366b8c6880721c310a5df675164..8356204007a6db4b34152ddf2d9108bd6d9775bf 100644 (file)
--- a/apc.conf
+++ b/apc.conf
@@ -1,79 +1,86 @@
 package UPSGRAPH;
 
-$host="10.50.252.253";
-$rrdfile="/var/www/usv/.work/ups.rrd";
 $outdir="/var/www/usv/";
-$community="public";
 $step=60;
 
-@fields = ( 'inputV', 'outputV', 'inputHZ', 'outputHZ', 'battT', 'battC', 'load', 'timeR', 'timeO' );
-
-$vars = {
-       'inputV' => {
-               'name' => 'Input Voltage',
-               'oidtext' => 'PowerNet-MIB::upsAdvInputLineVoltage.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.3.2.1.0',
-               'min' => '180',
-               'max' => '280',
-       },
-       'outputV' => {
-               'name' => 'Output Voltage',
-               'oidtext' => 'PowerNet-MIB::upsAdvOutputVoltage.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.4.2.1.0',
-               'min' => '180',
-               'max' => '280',
-       },
-       'inputHZ' => {
-               'name' => 'Input Frequency',
-               'oidtext' => 'PowerNet-MIB::upsAdvInputFrequency.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.3.2.4.0',
-               'min' => '40',
-               'max' => '60',
-       },
-       'outputHZ' => {
-               'name' => 'Output Frequency',
-               'oidtext' => 'PowerNet-MIB::upsAdvOutputFrequency.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.4.2.2.0',
-               'min' => '40',
-               'max' => '60',
-       },
-       'battT' => {
-               'name' => 'Battery Temperature',
-               'oidtext' => 'PowerNet-MIB::upsAdvBatteryTemperature.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.2.2.2.0',
-               'min' => '0',
-               'max' => '100',
-       },
-       'battC' => {
-               'name' => 'Battery Capacity',
-               'oidtext' => 'PowerNet-MIB::upsAdvBatteryCapacity.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.2.2.1.0',
-               'min' => '0',
-               'max' => '110',
-       },
-       'load' => {
-               'name' => 'UPS Load',
-               'oidtext' => 'PowerNet-MIB::upsAdvOutputLoad.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.4.2.3.0',
-               'min' => '0',
-               'max' => '110',
-       },
-       'timeR' => {
-               'name' => 'Time Remaining',
-               'oidtext' => 'PowerNet-MIB::upsAdvBatteryRunTimeRemaining.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.2.2.3.0',
-               'factor' => 1/6000,
-               'min' => '0',
-               'max' => '360',
-       },
-       'timeO' => {
-               'name' => 'Time On Battery',
-               'oidtext' => 'PowerNet-MIB::upsBasicBatteryTimeOnBattery.0',
-               'oid' => '1.3.6.1.4.1.318.1.1.1.2.1.2.0',
-               'factor' => 1/6000,
-               'min' => '0',
-               'max' => '360',
+$hosts =
+[
+       {
+               address => "10.50.252.253",
+               name => "usv1",
+               rrdfile => "/var/www/usv/.work/ups.rrd",
+               community => "public",
+               
+               fields => [ 'inputV', 'outputV', 'inputHZ', 'outputHZ', 'battT', 'battC', 'load', 'timeR', 'timeO' ],
+               
+               vars => {
+                       'inputV' => {
+                               'name' => 'Input Voltage',
+                               'oidtext' => 'PowerNet-MIB::upsAdvInputLineVoltage.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.3.2.1.0',
+                               'min' => '180',
+                               'max' => '280',
+                       },
+                       'outputV' => {
+                               'name' => 'Output Voltage',
+                               'oidtext' => 'PowerNet-MIB::upsAdvOutputVoltage.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.4.2.1.0',
+                               'min' => '180',
+                               'max' => '280',
+                       },
+                       'inputHZ' => {
+                               'name' => 'Input Frequency',
+                               'oidtext' => 'PowerNet-MIB::upsAdvInputFrequency.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.3.2.4.0',
+                               'min' => '40',
+                               'max' => '60',
+                       },
+                       'outputHZ' => {
+                               'name' => 'Output Frequency',
+                               'oidtext' => 'PowerNet-MIB::upsAdvOutputFrequency.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.4.2.2.0',
+                               'min' => '40',
+                               'max' => '60',
+                       },
+                       'battT' => {
+                               'name' => 'Battery Temperature',
+                               'oidtext' => 'PowerNet-MIB::upsAdvBatteryTemperature.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.2.2.2.0',
+                               'min' => '0',
+                               'max' => '100',
+                       },
+                       'battC' => {
+                               'name' => 'Battery Capacity',
+                               'oidtext' => 'PowerNet-MIB::upsAdvBatteryCapacity.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.2.2.1.0',
+                               'min' => '0',
+                               'max' => '110',
+                       },
+                       'load' => {
+                               'name' => 'UPS Load',
+                               'oidtext' => 'PowerNet-MIB::upsAdvOutputLoad.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.4.2.3.0',
+                               'min' => '0',
+                               'max' => '110',
+                       },
+                       'timeR' => {
+                               'name' => 'Time Remaining',
+                               'oidtext' => 'PowerNet-MIB::upsAdvBatteryRunTimeRemaining.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.2.2.3.0',
+                               'factor' => 1/6000,
+                               'min' => '0',
+                               'max' => '360',
+                       },
+                       'timeO' => {
+                               'name' => 'Time On Battery',
+                               'oidtext' => 'PowerNet-MIB::upsBasicBatteryTimeOnBattery.0',
+                               'oid' => '1.3.6.1.4.1.318.1.1.1.2.1.2.0',
+                               'factor' => 1/6000,
+                               'min' => '0',
+                               'max' => '360',
+                       },
+               },
        },
-};
+];
 
 1;
Impressum, Datenschutz