I'm trying to control Sanyo projectors (PLC-XU106) using snmp. Windows application PJ Network Manager uses snmp to get temperatures from projectors and to control its status (power on, outputs etc...).
Now I need to control it with a bash script using snmpget and other tools from net-snmp
Using snmpwalk -v 1 -c public 192.168.1.99
to get a subtree of management values, I get these values:
SNMPv2-MIB::sysDescr.0 = STRING: 1.001 00000 01012
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.17363.101.101.102.101.105
DISMAN-EVENT-MIB::sysUpTimeInstance = INTEGER: 0
SNMPv2-MIB::sysContact.0 = STRING:
SNMPv2-MIB::sysName.0 = STRING:
SNMPv2-MIB::sysLocation.0 = STRING:
SNMPv2-MIB::sysServices.0 = INTEGER: 64
IF-MIB::ifNumber.0 = INTEGER: 1
And with snmpwalk -v 1 -c public 192.168.1.99 SNMPv2-SMI::enterprises.17363.101.101.102.101.105
i get this:
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.101.0 = INTEGER: 1968
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.102.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.103.101.0 = STRING: "Computer1"
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.103.102.0 = STRING: "ANALOG"
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.103.103.0 = INTEGER: 2
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.104.101.0 = INTEGER: 32
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.104.102.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.105.101.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.105.102.0 = INTEGER: 4
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.101.101.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.101.102.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.101.103.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.102.101.0 = INTEGER: 347
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.102.102.0 = INTEGER: 432
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.102.103.0 = INTEGER: 308
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.107.101.0 = INTEGER: 3
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.107.102.0 = INTEGER: 1
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.107.103.0 = INTEGER: 1
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.108.0 = STRING: "XU106"
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.109.101.0 = INTEGER: -1
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.109.102.0 = INTEGER: 1
End of MIB
After some tests I've understood that some of these values are:
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.102.101.0 = INTEGER: 347
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.102.102.0 = INTEGER: 432
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.106.102.103.0 = INTEGER: 308
SNMPv2-SMI::enterprises.17363.101.101.102.101.105.101.0 = INTEGER: 1968
I can power on/off projector with http request:
curl -d "POWER+ON=ON" 192.168.1.99/index.htm
curl -d "POWER+OFF=Standby" 192.168.1.99/index.htm
But I guess there's a way to do this with snmp, like
snmpset -v 1 -c public 192.168.1.99 SNMPv2-SMI::enterprises.17363.101.101.102.101.105.102.0 i 128
It's likely that you need to do one of these:
1) find the MIB for the device that defines what each of the OIDs are. If you have that, you can configure Net-SNMP to display the results such that you get more than a string of numbers and a value and suddenly everything will make sense. But this looks difficult unless it comes with your network management software, as it doesn't seem to be easily findable online.
2) So option #2 is capture the traffic to the device as you toggle the power with PJ and open the capture in wireshark. It should show you exactly what OIDs are being SET over SNMP to toggle the power, etc. Then writing a script to mimic that using snmpset
is easy.