Hallo,
Currently I successful run my bash scripts on the checkmk instance.
This bash script returns (it should) also performance data.
But this data are not processed from check_mk.
What I’m doing wrong?
Maxe
Hallo,
Currently I successful run my bash scripts on the checkmk instance.
This bash script returns (it should) also performance data.
But this data are not processed from check_mk.
What I’m doing wrong?
Maxe
The script output looks more like local check. This script should be called be the agent as a local check. Then also the performance value is interpreted correctly.
There is also another problem i see. You put your script inside the folder “~/share/check_mk/custom/”.
That’s not good as with the next update your check is lost.
If it is a classic check please put the file inside “~/local/lib/nagios/plugins/”. For the command line definition you can then use the macro “$USER2$” as this is the path to the local plugins folder.
Such local checks like this one you can put inside “~/local/share/check_mk/agents/local” for instance but for the raw edition it is not so important. Only inside the “~/local/” structure to not get lost during update processes.
Hello,
This script should be called be the agent as a local check.
How do I do that? I have no glue.
Many thanks.
Maxe
If you use this script directly on your monitoring server you have to put it inside “/usr/lib/check_mk_agent/local/” it is executed every time the agent is queried.
You should automatically get performance data shown.
The “P” at the start of the line indicates that it is a local check who has a status that depends on the performance data and the limits of these. Only your performance data has no limits. That means the checks stays ok all the time.
If your output looks like this.
P Sensor_Aussen temp=9.81;35;45
You would get automatically a Warn at 35 and Crit at 45 degrees.
I do not have this directory on my server: /usr/lib/check_mk_agent/local/
How can I execute my script with an agent on my server?
You need to create this directory.
Is your monitoring server not monitored with the agent?
The how to is described here Monitoring Linux - The new agent for Linux in detail
Is your monitoring server not monitored with the agent?
This is the monitoring server itself.
Yes this one should also be monitored by the agent
Is your monitoring system by itself not included in your monitoring environment?
If it is then you only have to put your script in the folder i gave some posts before and you will get your result processed and also with graph.
Good morning.
I have exactly one Server. This is my CheckMK Server. And this is my whole monitoring environment.
This Server checks an Industrial embedded Box which provides some temperature sensors and others.
With a batch Script like this
!/bin/bash
# doing some other stuff here
echo "0 MySensor temp=22"
I query these Box. This script runs periodically on my Server.
How can I process this performance data on my CheckMK Server.
Maxe
Your CMK server needs to be a normal monitoring object in your setup like every other Linux server.
You should see there some OMD checks and normal Linux checks.
Like this example
If your server is visible inside your CMK instance you can put your local check script on your monitoring server inside the folder “/usr/lib/check_mk_agent/local/” it it will be executed every time the data from your agent is pulled. The processing of the performance data is done automatically. You don’t need to do anything for this.
That’s it.
Hello,
Your CMK server needs to be a normal monitoring object in your setup like every other Linux server.
In other words it is not possible to query and process performance data with a simle bash script directly an industrial Box without an additional server? That can’t be. This is a normal industrial requirenment.
With PRTG this is possible.
With NAGIOS Core this is possible.
Both with PRTG and NAGIOS I had a PoC up and running within 1 workday.
With CHECKMK, after a few days and some discussions in this forum and other locations a running PoC was not possible.
I tell my boss that checkmk does not fullfill so simple requirenments and is to complicated.
Thank you for your help.
??? With PRTG and NAGIOS you do exactly the same. You define an object and assign manually your check to this object. With CMK you don’t need to define an extra object as you should have already your monitoring server itself in your monitoring. You only need to deploy the script (your script is an CMK local check) on your monitoring server itself.
If you have not an local check but an classic Nagios check you can also use the “Classic active passive checks” (1.6) or “Integrate Nagios plugins” (2.0) rule to assign these checks to a dummy object in your monitoring. This is exactly the same what you do inside Nagios or PRTG.
As you asked for the integration of your local check script, i gave the direction for this integration.
If this is a PoC i would recommend to read the “Quick start guide” especially starting at Setting up monitoring to get all the concepts behind CMK.
The integration of classic Nagios checks is described here Monitoring network services (Active checks) - Monitoring of HTTPS, TCP, SSH, FTP and further services
With active checks your script needs to follow the original Nagios guidelines for the format of the output.
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.