I tried to configure nethserver as a slave nut to connect to a QNAP NAS UPS Server. The UPS itself (an APC UPS) is connected via USB to the QNAP NAS - this is working and correctly configured and recognized by the QNAP NAS. The IP Adress of the netherserver is also configured as slave on the QNAP NAS UPS configuration.
Problem:
However it seems to be hardcoded in Nethserver UPS/nut configuration to use the username “UPS” when trying to connect to the QNAP nut server. For QNAP NAS a different nut user would be required.
Broadcast message from nut@homeserver1.home.lan (Wed Jun 12 07:17:59 2019):
UPS UPS@10.0.1.5 is unavailable
According to
the nut username should be “qnapups”.
How can I change in best way the NUT username used in the netherserver nut configuration - also to be future prove for next upgrades?
Hi
It’s true that a lot of Linux Devices out there, including Nethserver, use NUT, but have hardcoded users / passwords for it.
NethServer, QNAP, Synology are among the many…
My solution is to use a Raspberry PI for NUT. Cheap, easy to replace / use the config at other places.
I have the Raspberry handle all my NUT requirements, and connect Nethserver, Synology, QNAP, Proxmox to the Raspberry as NUT-Server. The Raspberry reports to Zabbix Monitoring (On the Nethserevr).
Another benefit: Using the Raspberry instead of any NAS on site usually gives me more info about the battery. The built in NUT in many NAS are very simple (Do not use all possible options).
looking at file /etc/e-smith/templates/etc/ups/upsmon.conf/20access
[root@homeserver1 upsmon.conf]# more 20access
{
my $ip = '';
my $mode = '';
my $pass = ${'nut-server'}{'Password'} || ' ';
my $status = ${'nut-server'}{'status'} || 'disabled';
if ($status eq 'enabled') {
$ip = '127.0.0.1';
$mode = 'master';
} else {
$ip = ${'nut-monitor'}{'Master'} || '';
$mode = 'slave';
}
$OUT.="MONITOR UPS\@$ip 1 upsmon $pass $mode";
}
[root@homeserver1 upsmon.conf]#
It looks the UPS and the upsmon are hard coded in the template resulting in the line MONITOR UPS@10.0.1.15 1 upsmon 123456 slave
in file /etc/ups/upsmon.conf
This leads to the failure case (as logged in "/var/log/messages" of Jun 12 21:43:04 homeserver1 upsmon: Poll UPS [UPS@10.0.1.15] failed - [UPS] does not exist on server 10.0.1.15
Comparing it with the upsmon.conf file at my QNAP NAS: MONITOR qnapups@localhost 1 admin 123456 master
it looks to me somehow the hard-coded template would need to be updated? What do you think?