Hi @gonzo ,
You cannot get 4 values at once using YAML code. So the result you see here is “something”. Probably the code will try to “cast” the string to an int, resulting in a value which is not the one you expect.
Only solution here, write PHP code to extracts exactly the data you need.
Bye
I would try this approach. First, you create a php file to do the discovery, with includes/discovery/sensors/count/dhcpatriot.inc.php as a model. And you discover 4 times your sensor, but you change the “index” value to keep them all:
And then you write a piece of PHP in includes/polling/sensors/count/ that does more or less the same idea as includes/polling/sensors/count/dhcpatriot.inc.php . Basically, you have a chance to “edit” the variable here before it gets written to the DB. And for each of the 4 copies, you remove the 3 “unnecessary” values.
You should end up with 4 count sensors holding each of the 4 values.
You only kept the beginning of the file which defines variables. But all the “computing” that comes before, you removed it. The discovery file you came with does not do anything.
And the polling file needs to split the 4 values and put them in the 4 sensors you created in the discovery file. Right now, you copy pasted code that have no use for your situation. It deals with time/epoch for dhcpatriot.
I’m not sure what “computing” part you mean as I used dhcpatriot.inc.php as reference.
I really don’t know php, sadly I’m not sure I’ll be able to do this as it’s over my head I think.
The yaml files (discovery and definition) were ok and I’m glad they all work and have a 100s of devices using them, but getting these 4 addition string values to show that the snmp walk can seems too hard for me I think.
By computing, I mean that you removed more than half of the model discovery file. You kept only the part that initialize variables. Useless without the actual code that deals with it.
And, in term of reference, the files in the same directories may help you as well. But I haven’t seen any device doing exactly what you want to do. So the options are:
You find a way to do it, and we continue helping you
You live without those values
Or you wait until somebody with the same devices improve the support.
I’ll keep researching, so I understand can you paste the computing part I’m missing as I’ve checked and can’t see this? That would be really helpful.
I continue then continue to have a look. The company that looks after this device told us to use Solarwinds as it just works on there but I don’t want to.