Using Perl to communicate with Nut

2

I'm trying to communicate with my UPS that's managed using NUT. I want to read values from it like line voltage, battery charge, etc. I don't want to send it commands to shut it down.

At first I was going to mess around capturing the output of "upsc apc@remotehost" and parsing it with regexps.

... then I turned my brain on and had a look around CPAN and found the UPS::Nut module, except after trying it and realising it was last updated in 2002, it doesn't work with the latest version of NUT.

So is there a better way than parsing the output of upsc with regexps?

Piku

Posted 2014-03-17T22:02:47.940

Reputation: 557

No answers