User Tools

Site Tools


notes:zabbix-apcupsd-without-snmp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
notes:zabbix-apcupsd-without-snmp [2014/08/29 10:48] – created adminnotes:zabbix-apcupsd-without-snmp [2014/09/06 17:37] (current) admin
Line 1: Line 1:
 ====== Zabbix: Monitor an APC UPS with apcupsd (no SNMP required)  ====== ====== Zabbix: Monitor an APC UPS with apcupsd (no SNMP required)  ======
  
-UserParameter are +Monitoring an APC UPS without snmp is not so difficult. If you are already using the ''apcupsd'' daemon, feeding this data to Zabbix as UserParameter is all about putting the data into a file that Zabbix can read.
  
-/etc/zabbix/zabbix_agentd.conf +This is my configuration of ''apcupsd'' for a SmartUPS 5000 connected to the Local Network (1.2.3.4 is the IP address of my UPS -- change your ''/etc/apcupsd/apcupsd.conf'' file to match your network setup).
  
-UserParameter=apcupsd.linev,awk < /var/log/apcupsd.status '/^(LINEV).*:/ { print $3 }' +  ## apcupsd.conf v1.1 ## 
-UserParameter=apcupsd.loadpct,awk < /var/log/apcupsd.status '/^(LOADPCT).*:/ { print $3 }' +  UPSNAME SmartUPS5000 
-UserParameter=apcupsd.battcharge,awk < /var/log/apcupsd.status '/^(BCHARGE).*:/ { print $3 }' +  UPSCABLE ether 
-UserParameter=apcupsd.timeleft,awk < /var/log/apcupsd.status '/^(TIMELEFT).*:/ { print $3 }' +  UPSTYPE pcnet 1.2.3.4:apc 
-UserParameter=apcupsd.battv,awk < /var/log/apcupsd.status '/^(BATTV).*:/ { print $3 }'+  DEVICE 
 +  LOCKFILE /var/lock 
 +  UPSCLASS standalone 
 +  UPSMODE disable 
 +   
 +  POLLTIME 60 
 +  ONBATTERYDELAY 15 
 +   
 +  # BATTERYLEVELMINUTES, and TIMEOUT work in conjunction, so 
 +  # the first that occurs will cause the initation of a shutdown
 +  BATTERYLEVEL 10 
 +  MINUTES 5 
 +  TIMEOUT 0 #set it to 0 for SmartUPS devices 
 +   
 +  STATTIME 50 
 +  STATFILE /var/log/apcupsd.status 
 +  LOGSTATS off 
 +  DATATIME 0
  
 +As you can see in the config file, the UPS status is dumped every 50 seconds within the ''/var/log/apcupsd.status'' file.
 +The status of the UPS can be seen with the ''apcaccess'' command
  
-/etc/apcupsd/apcupsd.conf +  APC      : 001,050,1290 
-## apcupsd.conf v1.1 ## +  DATE     : 2014-04-23 10:14:44 +0200   
-UPSNAME SmartUPS5000 +  HOSTNAME : faxserver 
-UPSCABLE ether +  VERSION  : 3.14.8 (16 January 2010) debian 
-UPSTYPE pcnet 192.168.0.220:apc +  UPSNAME  : SmartUPS5000 
-DEVICE +  CABLE    : Ethernet Link 
-LOCKFILE /var/lock +  MODEL    : PCNET UPS Driver 
-UPSCLASS standalone +  UPSMODE  : Stand Alone 
-UPSMODE disable+  STARTTIME: 2014-04-23 10:14:44 +0200   
 +  STATUS   : ONLINE  
 +  LINEV    : 229.3 Volts 
 +  LOADPCT  :  27.2 Percent Load Capacity 
 +  BCHARGE  : 100.0 Percent 
 +  TIMELEFT :  37.0 Minutes 
 +  MBATTCHG 10 Percent 
 +  MINTIMEL : 5 Minutes 
 +  MAXTIME  : 0 Seconds 
 +  MAXLINEV : 229.3 Volts 
 +  MINLINEV : 229.3 Volts 
 +  OUTPUTV  : 229.2 Volts 
 +  DWAKE    : 010 Seconds 
 +  DSHUTD   : 020 Seconds 
 +  DLOWBATT : 02 Minutes 
 +  LOTRANS  : 160.0 Volts 
 +  HITRANS  : 255.0 Volts 
 +  RETPCT   : 000.0 Percent 
 +  ITEMP    : 23.0 C Internal 
 +  ALARMDEL : Always 
 +  BATTV    : 218.4 Volts 
 +  LINEFREQ : 50.0 Hz 
 +  LASTXFER : Automatic or explicit self test 
 +  NUMXFERS : 30 
 +  XONBATT  : 2014-08-23 15:11:35 +0200   
 +  TONBATT  : 0 seconds 
 +  CUMONBATT: 174 seconds 
 +  XOFFBATT : 2014-08-23 15:11:43 +0200   
 +  LASTSTEST: 2014-08-23 15:11:35 +0200   
 +  SELFTEST : OK 
 +  STESTI   : 336 
 +  STATFLAG : 0x07000008 Status Flag 
 +  REG1     : 0x00 Register 1 
 +  REG2     : 0x00 Register 2 
 +  REG3     : 0x00 Register 3 
 +  MANDATE  : 02/21/2012 
 +  SERIALNO : IS1209001282 
 +  BATTDATE : 02/21/2012 
 +  NOMOUTV  : 230 Volts 
 +  EXTBATTS : 0 
 +  FIRMWARE : 5.1 (ID5) 
 +  APCMODEL : Smart-UPS RT-5000 XL-1 
 +  END APC  : 2014-08-29 13:49:30 +0200  
  
-POLLTIME 60 +We are interested in line/battery voltages, UPS load and battery charge.  
-ONBATTERYDELAY 15+With ''awk'' we can easily get these values and provide them to Zabbix Server as User Parameter. 
 +On the host that runs zabbix_agentd, edit the ''/etc/zabbix/zabbix_agentd.conf'' and insert the following lines:
  
-# BATTERYLEVELMINUTESand TIMEOUT work in conjunctionso +  UserParameter=apcupsd.linev,awk < /var/log/apcupsd.status '/^(LINEV).*:/ { print $3 }' 
-# the first that occurs will cause the initation of a shutdown+  UserParameter=apcupsd.loadpct,awk < /var/log/apcupsd.status '/^(LOADPCT).*:/ { print $3 }' 
-BATTERYLEVEL 10 +  UserParameter=apcupsd.battcharge,awk < /var/log/apcupsd.status '/^(BCHARGE).*:/ { print $3 }' 
-MINUTES 5 +  UserParameter=apcupsd.timeleft,awk < /var/log/apcupsd.status '/^(TIMELEFT).*:/ { print $3 }' 
-TIMEOUT 0 #set it to 0 for SmartUPS devices+  UserParameter=apcupsd.battv,awk < /var/log/apcupsd.status '/^(BATTV).*:/ { print $3 }'
  
-STATTIME 50 +and restart the zabbix_agent. 
-STATFILE /var/log/apcupsd.status + 
-LOGSTATS off +In the Zabbix web interface 
-DATATIME 0+  - Install the zbx_apcupsd_template.xml (it has 5 items and 2 triggers for generating Power Down and Low Battery alerts) ([[http://pastebin.com/raw.php?i=aCF1Jkht|zbx_apcupsd_template.xml]]) 
 +  - Add the "apcupsd Template" to the monitoring host
notes/zabbix-apcupsd-without-snmp.1409309292.txt.gz · Last modified: 2014/08/29 10:48 by admin