Custom scripts in local folder for Solaris not discovered in check_mk services

CMK version: 2.0.0p23
OS version: solaris

Error message: custom scripts are not discovered in check_mk services

Hi, I have installed check_mk 2.0.0p23 (CFE) on monitoring server and downloaded check_mk_agent.solaris 2.0.0p23 version and configured by adding the necessary folders such as /usr/lib/check_mk_agent/local , /usr/lib/check_mk_agent/plugins , /etc/check_mk, /var/lib/check_mk_agent etc.,
I have added some custom scripts to my local folder i.e. /usr/lib/check_mk_agent/local with executable permission, but the same is not reflecting on the discovered services while other services are discovered and showing.
Can someone help here please? All my custom scripts for other Linux servers are pretty much showing.

I am still looking for a solution. Any help here?

Why are you creating the folders manually ?

If you just the .pkg on your Solaris server, it should create all of them automatically.
Have you tried running the local check manually ?

1 Like

Please share a listing of the agent folders and the content of one of the scripts.

I did not add the .pkg. I copied a check_mk_agent.solaris file to /usr/bin folder.
Could that be the reason? Should I add the .pkg file on all Solaris agents and try?

Agent folders I created are:
/usr/lib/check_mk_agent/local
/usr/lib/check_mk_agent/plugins
/etc/check_mk
/var/lib/check_mk_agent

Script to check Clearcase service running:

#!/bin/bash

status=$(/etc/init.d/clearcase status | grep “running”)
if [[ $status == “running” ]]; then
echo “0 “Clearcase Service” - Clearcase is running”
else
echo “2 “Clearcase Service” - Clearcase is NOT running”
fi

I would install the agent via the .pkg file, as @davidwayne suggested.

Apart from that: What happens if you run your script manually, as @davidwayne also suggested?

Lastly: Why not use the service or process discovery instead of a local script?

Hi @robin.gierse - Sorry for the late response. I was unavailable.
Locally when I run the script, it outputs the expected result. But when I run /usr/bin/check_mk_agent, I cannot see <> scripts in the output.

When I use service discovery from WATO, I cannot see the running local script.
Is there any other alternative approach to discover the scripts? The reason why I am writing a local script is because we need to monitor some services for which there is no plugin available and also we need to monitor some specific folders.

What are the permissions of the script? They need to allow execution of the script.

If you search for ‘process discovery’ in the Setup, it might get clearer, what I am suggesting.

@robin.gierse So I should add the script as below??

image

No, the rule set checks for a running process. So you could check, if the Clearcase program from your script is running, without needing a custom script. There is also a service discovery rule set, which checks for Linux services, which might serve you even better.

Also, I cannot help but recognize, that you did not share the permissions of the script.

Hi @robin.gierse,

The script got executable permission 775. And locally running good.
Nope, the process discovery rule set is not identifying Clearcase specifically :frowning:

Is there any better way to replicate solaris services using custom scripts?

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.