I’m trying to use graph_image.py to request specific graphs, based on: werk 4733. Currently when requesting a graph image I have to pass in a graph index to get a graph. How do I figure out which graph belongs to which graph index. It seems like the graphs are in alphabetical order when requesting them this way, but I want to get them based on the order or name of the performance data.
I’ve been trying a few different approaches but nothing useful so far. Looking at the service graphs in check mk, those are ordered alphabetically. This is also the order in which graph_image.py returns the graphs. For example:
The performance data is ordered in the way they are output by the check. In my case this means “status” is always first, then the performance data in the order they are created and finally “evaluationtime” is always last:
If I use the web api to call “get_metrics_of_host” it returns:
“metrics”: {
“evaluationtime”: {
“index”: 0,
“name”: “evaluationtime”,
“title”: “Evaluationtime”
},
“status”: {
“index”: 1,
“name”: “status”,
“title”: “Status”
},
“ccc”: {
“index”: 2,
“name”: “ccc”,
“title”: “Ccc”
},
“aaa”: {
“index”: 3,
“name”: “aaa”,
“title”: “Aaa”
},
“bbb”: {
“index”: 4,
“name”: “bbb”,
“title”: “Bbb”
}
Which is the order in which the graphs were created. So not alphabetical and not in the order the check output the data. Here you can also see I added the “bbb” graph last, but it is now at graph_index 3 because it is 3th in alphabetical order.
So, basically there are 3 now different orders of performance data I can look at. Yet the only order in which I can request a graph image is alphabetical, which can change over time if the performance data are changed. The order I want to use is the one shown in “Service performance data (source code)” because I know exactly in which order these are.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.