User Tools

Site Tools


ups

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ups [2022/05/16 00:02] vissieups [2022/05/16 23:26] (current) – [Setup NUT (Network UPS Tools)] vissie
Line 2: Line 2:
  http://www.bernaerts-nicolas.fr/linux/75-debian/335-debian-wheezy-install-monitor-eaton-ups  http://www.bernaerts-nicolas.fr/linux/75-debian/335-debian-wheezy-install-monitor-eaton-ups
   sudo apt-get install nut nut-monitor   sudo apt-get install nut nut-monitor
 +To get vendorid and productid if you have more than one UPS:
 +  lsusb  
 +Lookup UPS from dmesg to find driver to use
 + https://networkupstools.org/stable-hcl.html
  
   sudo vim /etc/nut/ups.conf    sudo vim /etc/nut/ups.conf 
Line 9: Line 13:
 port = auto port = auto
 desc = "Eaton E5 1100" desc = "Eaton E5 1100"
 +vendorid = 0463
 +productid = ffff
 </sxh> </sxh>
   sudo upsdrvctl start   sudo upsdrvctl start
Line 23: Line 29:
   sudo systemctl restart nut-server.service    sudo systemctl restart nut-server.service 
   sudo systemctl status nut-server.service    sudo systemctl status nut-server.service 
 +  sudo systemctl enable nut-server.service 
   upsc eaton   upsc eaton
 +  
 +=====upsmon configuration=====
 +The last step is to configure upsmon to listen to upsd and take action on events.
 +  vim /etc/nut/upsmon.conf
 +<sxh bash; gutter: false>
 +MONITOR upsname@localhost 1 upsduser password master
 +</sxh>
 +
 +Create a notify send script file of sorts 
 +  vim ./send_simple.py 
 +<sxh bash; gutter: false>
 +#!/usr/bin/python3.7
 +import telegram
 +import sys
 +TOKEN = 'mytokenhere1234567890987654321'
 +user_id = '01234567890'
 +msg = sys.argv[1]
 +bot = telegram.Bot(token=TOKEN_vissie_bot)
 +bot.send_message(chat_id=user_id, text=msg)
 +</sxh>
 +  sudo vim /etc/nut/upsmon.conf 
 +<sxh bash; gutter: false> 
 +RUN_AS_USER root
 +MONITOR apc-1500@localhost 1 admin xxxx master
 +MINSUPPLIES 1
 +NOTIFYCMD /usr/sbin/send.py
 +POLLFREQ 2
 +POLLFREQALERT 1
 +NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
 +NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
 +NOTIFYFLAG LOWBATT  SYSLOG+WALL+EXEC
 +</sxh>
 +  sudo systemctl status nut-monitor.service 
 +  sudo systemctl start nut-monitor.service 
 +  sudo systemctl enable nut-monitor.service 
 +
ups.1652684528.txt.gz · Last modified: 2022/05/16 00:02 by vissie