The query will return port number start at Index 0 instead of 1. (Useful when your switch port ID start at 0!)
===================================================
2. If you want value based on an external script with hostname and index as parameter
This will execute the script between the cmd tag and will attach the hostname and indexid as first and second parameter. My test.sh script go into my MySQL database and give me the hostname of what is connected to the give Index (port ID - 1).
===================================================
SO now I can put the hostname or the real port id into my data source and graph!
Let me know what do you think about that. For sure I will improve that a lot. But for me that's a good start.
There is a better way to handle this with the new OID type called "OID_PARSE" method introduced in Cacti 0.8.6c. I just have not had time at the office to create the Catalyst Interface XML file.