[Nut-upsdev] UPS gracefull restart

Tomáš Macek macek at fortech.cz
Wed May 21 07:06:44 UTC 2008



Arjen de Korte wrote:
>> I'm just looking at the code of snmp-ups driver in the source tree.
>> I'm trying to find out, what can I change in the code to force the
>> snmp-ups driver to send shutdown command to the upsd to shutdown the
>> computer when I set up on the UPS via telnet that it should restart
>> gracefully.
> 
> The 'upsd' server sits between (in your case) the snmp-ups driver and
> (usually) upsmon client. The latter will shutdown the system if it sees
> that the UPS is both reporting On Battery (OB) and Low Battery (LB) or
> when the Force ShutDown (FSD) flag is set. Since drivers should *never*
> set the FSD flag directly, your only option here is to make the snmp-ups
> driver reports both OB and LB. Any clients attached should respond to this
> by shutting down.
> 
> Best regards, Arjen

Many thanks for help.

I have now apccmib.h

#define APCC_OID_POWER_STATUS   ".1.3.6.1.4.1.318.1.1.1.4.1.1.0" 
 

/* Defines for APCC_OID_POWER_STATUS */ 
 

info_lkp_t apcc_pwr_info[] = { 
 

     { 1, "" },          /* unknown  */ 
 

     { 2, "OL" },        /* onLine */ 
 

     { 3, "OB" },        /* onBattery */ 
 

     { 4, "BOOST" },     /* onSmartBoost */ 
 

     { 5, "OFF" },       /* timedSleeping */ 
 

     { 6, "OFF" },       /* softwareBypass  */ 
 

     { 7, "OFF" },       /* off */ 
 

     { 8, "OB LB" },          /* rebooting */ 
 

     { 9, "BYPASS" },    /* switchedBypass */ 
 

     { 10, "BYPASS" },   /* hardwareFailureBypass */ 
 

     { 11, "OFF" },      /* sleepingUntilPowerReturn */ 
 

     { 12, "TRIM" },     /* onSmartTrim */ 
 

     { 0, "NULL" } 
 

} ;

Is this what you were talking about? I have no other idea what else to 
do looking at the code.

Best regards, Tomas



More information about the Nut-upsdev mailing list