Abilitare le notifiche via mail in Nut UPS: Difference between revisions
Jump to navigation
Jump to search
m New page: * Installare mail sudo aptitude install mailx * Cambiare la descrizione dell'utente Nut sudo usermod -c "Nut UPS ${HOSTNAME}" nut * Abilitare le notifiche e definire il comando da eseg... |
mNo edit summary |
||
| Line 21: | Line 21: | ||
NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC | NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC | ||
NOTIFYFLAG FSD SYSLOG+WALL+EXEC | NOTIFYFLAG FSD SYSLOG+WALL+EXEC | ||
EOFile | |||
</pre> | </pre> | ||
Revision as of 14:58, 9 September 2010
- Installare mail
sudo aptitude install mailx
- Cambiare la descrizione dell'utente Nut
sudo usermod -c "Nut UPS ${HOSTNAME}" nut
- Abilitare le notifiche e definire il comando da eseguire:
cat | sudo tee -a /etc/nut/upsmon.conf > /dev/null <<EOFile NOTIFYCMD /usr/local/bin/nut-notify NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC NOTIFYFLAG FSD SYSLOG+WALL+EXEC EOFile
- Creare lo script di notifica
cat | sudo tee /usr/local/bin/nut-notify > /dev/null << EOFile
#!/bin/sh
echo "$*" | mail -s "${HOSTNAME} UPS Notice" gal-alert@rvmgroup.it
EOFile
sudo chmod +x /usr/local/bin/nut-notify
- Riavviare Nut
- È possibile usare upssched se si vogliono mandare gli alter solo dopo un tot tempo (VEdi Riferimenti)
Riferimenti
- Make your UPS email you with NUT | Interphero Miscellany
- [Make your UPS email you with NUT Interphero Miscellany: Customize UPS-related alerts in NUT]