Daily Reports


#1

Hello Board,

sorry for my bad english, I hope everyone can understand me.

I’m new to check_mk and use the RAW Version of check_mk.
I registered 7 different Server and monitor the free space on every server with check_mk.

Now I want to get a email every day, with the free space on every Server.

Is it possible to do this with the RAW Version of check_mk?

Kind regards
Johannes


(Philipp Näther) #2

The cmk notification system is not made for reporting current states of hosts/services automatically. It is made for alerts, which in your case would not be present.
There is the reporting functionality which would fit your needs I believe, but that is only available in the cmk enterprise edition.
To achieve what you are looking for you have to write a script which fetches the current state of a service via livestatus query and sends it via mail command to the desired address. The script execution can be controlled by a cron job.

Information about how to use livestatus can be found here:

EN https://mathias-kettner.com/cms_livestatus.html
DE https://mathias-kettner.de/cms_livestatus.html


#3

How do I use this scripts ?


(Philipp Näther) #4

To extract a service with its status for example:

echo -e "GET services\n Columns: host_name description state\nFilter: host_name = HOST\nFilter: description = yourservice" | unixcat ~/tmp/run/live

If unixcat is not available on your system, you can also use nc -U to access the local unix socket.
On of the columns in the livestatus output is “plugin_output”. That might be interesting for you aswell for generating mails.