Ad Widget

Collapse

Zabbix template for apcupsd

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AbyssMoon
    Member
    • Nov 2012
    • 51

    #1

    Zabbix template for apcupsd

    Made a template for monitoring ups APC using apcupsd on Linux.

    ups.conf
    Code:
    UserParameter=ups.temperature,/sbin/apcaccess | grep ITEMP | awk '{print $3}' | cut -c-2
    UserParameter=ups[*],/sbin/apcaccess | grep $1 | sed "s/[^:]*\://" | sed -e 's/^.\{1\}//'
    UserParameter=ups.param[*],/sbin/apcaccess | grep $1 | sed "s/[^:]*\://" | sed -e 's/^.\{1\}//' | awk "{print $ 1}" | head -1
    Questions, please.
    Template in attachment.

    Сам искал давно такой шаблон - сделал сам...
    Attached Files
    Last edited by AbyssMoon; 21-11-2014, 09:38.
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Originally posted by AbyssMoon
    Made a template for monitoring ups APC using apcupsd on Linux.

    ups.conf
    Code:
    UserParameter=ups.temperature,/sbin/apcaccess | grep ITEMP | awk '{print $3}' | cut -c-2
    UserParameter=ups[*],/sbin/apcaccess | grep $1 | sed "s/[^:]*\://" | sed -e 's/^.\{1\}//'
    UserParameter=ups.param[*],/sbin/apcaccess | grep $1 | sed "s/[^:]*\://" | sed -e 's/^.\{1\}//' | awk "{print $ 1}"
    Questions, please.
    Template in attachment.

    Сам искал давно такой шаблон - сделал сам...
    For example instead "grep ITEMP | awk '{print $3}'" you can use "awk '/ITEMP/ {print $3}'.
    Instead "sed "s/[^:]*\://" | sed -e 's/^.\{1\}//'" you can use "sed "s/[^:]*\://l 's/^.\{1\}//'".
    If you will write filters a little better you can do everything using single awk or sed command and no other commands.
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • ModularConfusion
      Junior Member
      • Apr 2024
      • 23

      #3
      Is it possible to detect if the UPS is on AC power or not with this?

      Update: I made a trigger that detects if the input voltage is low:

      max(/Template apcupsd Linux/ups.param[LINEV],1m)<90
      Last edited by ModularConfusion; 02-11-2025, 21:52.

      Comment

      Working...