Script to monitor apcupsd on remote server

Script to monitor apcupsd on remote server

Opmanager Version 11600 on Windows 2008

$servername = psexec \\servername c:\apcupsd\bin\apcaccess status -p BCHARGE -u
Write-Host 'Data:'
Write-host $servername

I am running the above Powershell commands from the Opmanager server to get the battery charge from a server running APCUPSD and trying to convert this into a script template.  The value returned by the command is 100.0 if all is OK and want to set the threshold to alert if this drops below 50.0 but cannot get the script to work.  Have tried following the example scripts and the help card as well as old forum posts but can't seem to get the format right.  Can anyone assist in converting this to a working script please and maybe point out what I'm doing wrong?

Many thanks,

Justin

                New to ADManager Plus?

                  New to ADSelfService Plus?