We are trying to get multiple values from a MYSQL query and we would like to assign these multiple values to multiple channels on the same sensor. The way we have it working for now is that we run multiple queries and we assign each query result to a different sensor. That is putting extra load on our DB and it is not a scalable solution. Here is an example:
Select v1,v2,v3,v4,v5 from my_table;
It would be nice if we can run this inside one MYSQL sensor and assign these values to different channels in the sensor.
We have to go around and do the following:
Select v1 from my_table;
Assign the value to sensor 1
Select v2 from my_table;
Assign the value to sensor 2.
... and so on.
I hope my explanation is covering what we are trying to accomplish. Thank you.
Article Comments
You can now do this using the EXEXML sensor. You'll need to return the results as XML for PRTG to read in. Take a look at the Custom Sensors section of the API documentation for more information. I'm using it, and it works well to address this need.
Good luck!
Nov, 2010 - Permalink
First of all, thank you all for your thoughts, we appreciate such kind of feedback of course!
Let me please give you just a little insight. When PRTG 7 was released a sensor had to have a fixed number of channels when it was created, and it had to keep this number, otherwise the PRTG Core Server might have stumbled into critical problems. This stayed this way a long time with version 7. And as we don't have any information or even control about scripts used as sensors by our customers (scripts might change, might be improved, ec.), we limited the Custom sensors to have 1 Channel and fixed it to be that way.
Then we enabled a sort-of "dynamic creation" of channels in the probe for some our our "own" default sensors. This mechanism hasn't been applied yet for the script sensors, but we do consider it. It's just that of course we still want to have a stable PRTG if we enable/open this, and therefore this has to be really thoroughly thought through and also tested. Please bear with us.
Best Regards.
Nov, 2010 - Permalink
Just passing to reinforce the need of multiple channels on the same sensor. Furthermore, it would be great to have a mix of snmp and "factory channels" on the same sensor. Please start thinking about it.
Regards
Dec, 2010 - Permalink
Just so that you can see, that we are on this topic. For Exe/Script-Sensors multiple channels are already in "BETA"-Status (it might actually be already available in your PRTG, check under "Custom Sensors"->"EXE/Script Advanced".), it's documented under "Setup"->"PRTG API"->"Custom Sensors". For the other sensor types, please bear with us.
Dec, 2010 - Permalink
did the ability to create multple channels ever flow down to the mysql sensor?
Jul, 2013 - Permalink
Sorry, the SQL-Sensors are still limited to one Query and so then one channel for this. We recommend then to work with several SQL-Sensors and combine their results in a Sensor Factory Sensor.
Jul, 2013 - Permalink
Use "JOIN-ed" select like this:
select A.VARIABLE_VALUE as 'Open_files', B.VARIABLE_VALUE as 'Opened_files' from information_schema.GLOBAL_STATUS as a join ( select VARIABLE_VALUE from information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Opened_files') as B where A.VARIABLE_NAME = 'Open_files';
Apr, 2016 - Permalink
Dear James,
I'm afraid this is not possible with PRTG in the moment, and also not planned for near future releases. You can of course continue to use multiple SQL-Sensors and then combine the results with the Sensor Factory.
Best Regards.
Oct, 2010 - Permalink