I have a network switch that I am controlling and monitoring with SNMP HERE. one OID reads if the port is inuse or not and the other controls if it is on and off.There is a read command that returns if it is active or inactive. and a write command that sends enable and disable command for each port. I would like to display and control all of this from a single line item in the website. There are 3 states essentially to each port not counting link speed. Active, Inactive, and Disabled anyone have a simple way to achieve this my switch has 24 ports so it is alot of lines of code.
Create your port Items as a Number or a String so it can represent the three states.
When you put them on your sitemap use a ‘mappings[state1value=“button label 1”, statevalue2=“button label 2”, statevalue3=“button label 3”]’ where statevalue* is what ever the actual state of the Item is (e.g. if you use a Number for the Item and represent Active with a 1 it would be
This will put three buttons on your sitemap for that Item with the active one colored red and the other two blue. I don’t know if there is anyway to change the color of the buttons though.
Unfortunately you will have to do this for all 24 ports.