Include host or service comments to host/service-notifications

Hi,

we are using Host and Service-Comments for communicating certain operational stuff to ops-personnel, e.g. “from 7am to 6pm call person xyz - from 6am to 7pm cry lonely - but don’t tell anyone”

Is there any way in general with icinga2 and with Icinga-director (current most actual version) in our specific case to stuff all comments attached to a host/service into one variable (we could also live with the most actual comment - i.e only one comment) into a variable and pass it to a notification-script?

I googled and browsed through found documentation - but nothing did really match with my problem.

Thanks in advance!

Instead of using the comments which are a runtime value and not an attribute of the host, I recommend my customers to use notes or a custom variable at the host. The advantage is that it can not get lost so easily and easy access like your needed access for notifications. The disadvantages is you need access to the configuration to write these notes instead of only access to the command.

An option which comes to my mind would be a script collecting the comments and adding them to the notes field to make it persistent, this could be a one-time migration or a long-term solution when you do not want to give access to the configuration.

That’s exactly the reason we moved to the comments - and just realized our fate a bite later :slight_smile:

Thank you - I will consider your hint using notes or an additional attribute in combination with a batch collector. Would be fine to be able to run the batch collector e.g. every 15mins with a query only collecting comments changed/added during the last 15mins or something like that - I wouldn’t like to copy e.g. 6000 comments with this frequency - but new comments shouldn’t be available “hours of hours later” thinking :slight_smile:

Thank you for the quick response - have a nice weekend!