Display dummy service with a sum of existing services

I’m wondering if its possible to display the sum of existing services as one new service.

Lets assume:

  • you are monitoring a set of backup servers
  • You are interested in backup success
  • you see no way to query all the backup servers at one, only one by one is possible
  • there is no way to do something local somewhere, because the only one to reach all of them is the monitoring server

Now, my idea is: all the data is there. Statistics of all the backup services, but I need it as a sum, then calculated in percentage.

For your reference, this is what I’m talking about. Now, you see some backup servers only back up 10 or less clients. If one of them fails, we are hitting the SLAs. The SLA is only interesting as a total, not per server.

I came across this Article, that seems to do something similar, but i’m not really sure how to adopt it to this case.

The road to go would be like in the blog post to utilize the functions of Icinga 2 to calculate the state internally, but this is only easy if you use the state and simply concat the output. In your case you would need to parse the output, store the relevant data in variables, use functions to calculate the state based on this variables and create some output.

While I think this is possible with Icinga 2’s functions, I think it is easier with a separate script which gets the data from the database and then does all the calculation, just because it is more flexible.

If the data are not only in the output but also stored as performance metrics this backend would be another option to query and then calculate the overall state. This option could be simpler as output parsing can be avoided and functions of the metric system could be used, but it depends on knowledge where most people are more familiar with old fashioned database I think.

1 Like