upsconfer is a python library to get info and configure UPS devices.
- Socomec Netys with NetVision management cards (
UpsSocomecNetys
) - Socomec Masterys with NetVision management cards (
UpsSocomecMasterys
) - Socomec Digys with NetVision management cards (
UpsSocomecMasterys
) - Riello UPS with Netman 204 management cards (
UpsRielloSentinel
)
- Socomec NETYS RT 1/1 UPS
- Socomec MASTERYS 3/3
- Socomec DIGYS 3/3
- Riello Sentinel Dual SDH 2200 (UMO3)
ups = upsconfer.UpsSocomecNetys(host='myups.example.com', 'user='admin', password='mypass')
Log into device's management interface.
On most supported devices you need to call this method before doing any other operations.
Log out of device's management interface.
Some devices support only one concurrent management session. So it is advisable to call this method when you're done with a device to allow other users to login immediately. Otherwise they would have to wait for the current management session to timeout due to inactivity.
Returns a serial number of the device as a string.
Returns a dict with device info.
{
'manufacturer': 'Socomec',
'model': 'NETYS RT 1/1 UPS',
'serial': '123456789',
'firmware': '1.0',
'agent_type': 'NetVision',
'agent_firmware': '2.0h',
'agent_serial': 'D1111',
'mac_address': '00:11:22:33:44:55',
'rating_va': '2200',
'rating_w': '1900',
'battery_capacity_ah': '7',
}
Returns a dict with SNMP configuration.
{
'default': {
'community': 'public',
'access': 'none'
},
'1': {
'ip': '10.8.7.6',
'community': 'public',
'access': 'ro',
},
'2': {
'ip': '10.66.66.66',
'community': 'secret1',
'access': 'rw'
},
}
default
key represents all other management stations.ip
is the address or subnet (if supported by device) of the SNMP client.access
is one ofnone
,ro
orrw
.
Sets SNMP configuration from new_config dict.
Optional keys that are not supported by this device type are silently ignored.
Returns SNMP Trap configuration.
{
'1': {
'ip': '10.6.8.7',
'community': 'public',
'version': 2,
'severity': 'info',
'type': 'rfc',
'alias': 'nms.example.com'
}
}
ip
andcommunity
are mandatory. Other keys are optional.version
determines the version of SNMP traps that will be sent out. Should be one of 1 or 2.severity
determines the level of traps that should be sent to this reciever. Should be one of:none
,info
,warn
,crit
.type
specifies the MIB from which the traps will be sent out. Valid values arerfc
orproprietary
.alias
is a user friendly display name for this trap reciever.
Sets SNMP trap configuration from new_config dict.
Optional keys that are not supported by this device type are silently ignored.
Reboot the management interface. On some devices some configuration changes can only be applied after a reboot.