Internal documentation only
This page has been marked as draft.
Bulk delete comments
There are cases when user wants to delete all comments associated with services in bulk.
Possible Solution:
The way to do this is by listing all comments in a listview page (and perhaps do some sorting/filtering) using queries like:
[comments] all
You can match this on specific hosts:
[comments] host.name = "poller1"
Or service regex:
[comments] service.description ~ "Port"
Then you can mark (tick the box) the ones you wish to delete, and in the bulk-menu in the upper right corner click Delete comment.
These comments are held by Naemon during runtime and are saved between restarts in:
/opt/monitor/var/status.sav
So it’s also possible to instead shut down naemon (mon stop), find the comment blocks, delete them, and start naemon back up. The blocks will look something like this, depending on whether it’s a service comment or a host comment:
servicecomment {
host_name=172.16.40.1
service_description=HTTP Server
entry_type=1
comment_id=993
source=1
persistent=1
entry_time=1582549231
expires=0
expire_time=0
author=monitor
comment_data=foo
}
hostcomment {
host_name=172.16.40.1
entry_type=1
comment_id=994
source=1
persistent=1
entry_time=1582549356
expires=0
expire_time=0
author=monitor
comment_data=bar
}
Note: Remember to make a backup of this .sav file before making any changes to it, as it contains a lot of state information you likely do not want to lose.
There are also (unsupported) third-party tools that you may want to try in a test environment that claims to make this easier.