For various reasons I need to send checks from my monitored host to the checkmk server. I can only go one way, because of the firewall settings the monitored host can’t be reached by the server, but I am able to send from the monitored host to the checkmk server. I have already setup a passive service on the checkmk server. After running this command:
echo “[$(date +%s)] PROCESS_SERVICE_CHECK_RESULT;myserver;TEST;0;great works” > ~/tmp/run/nagios.cmd
I receive this message, so I know it works. But how would I get the monitored host to send its messages to the checkmk server? I would need this to monitor a mysql server eg ping, db state, etc.
If you can push data from the host to the monitoring server you can have the checkmk agent run by cron every minute and ship its output via network (e.g. scp) to a directory on the monitoring server.
You can configure via the ruleset “Individual program call instead of agent access” to use “cat /path/to/file_with_agent_output” instead of a direct agent query via 6556/tcp.
This has the advantage that you can use all the agent monitoring features including the mysql agent plugin.
See Can we monitor a host without passive connection
Same scenario (despite the wrong question title).
Thanks sander and dirk, that was pretty helpful. It was hard for me to figure out how to “link” the cated file to a host as I’m new to check_mk, but finally I got it to work - Thank you.
That’s good to hear.
I think especially @martin.schwarz’s answer to the other post explains it very good and concise.
See also my answer to this related question: Agent-initiated checks instead of server-initiated checks. The “trick” I use there avoids that half-transmitted files get cated on the server side.
The $(hostname -f) thing gets replaced with the client’s fully qualified hostname. If the client is configured with that name in checkmk then you can create the datasource rule with cat /path/to/$HOSTNAME$. checkmk will replace $HOSTNAME$ with the hostname as configured in checkmk.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.