Check_disk plugin on Linux hosts - Crash Report in Check_mk

Hi,

v2.0.0p1 - I am getting crash reports when using the Nagios plugin check_disk. It was working on the previous v1.6.0p22: “check_disk -w 25% -c 15% -p /” and this works on the hosts just fine.

#Crash Report#

Exception
TypeError (invalid character(s) in metric name: ‘/’)

Traceback
File “/omd/sites/SITE01/lib/python3/cmk/base/checking.py”, line 577, in get_aggregated_result
result = _aggregate_results(check_function(**kwargs))
File “/omd/sites/SITE01/lib/python3/cmk/base/checking.py”, line 808, in _aggregate_results
perfdata, results = _consume_and_dispatch_result_types(subresults)
File “/omd/sites/SITE01/lib/python3/cmk/base/checking.py”, line 852, in _consume_and_dispatch_result_types
for subr in subresults:
File “/omd/sites/SITE01/lib/python3/cmk/base/api/agent_based/register/check_plugins.py”, line 89, in filtered_generator
for element in generator(*args, **kwargs):
File “/omd/sites/SITE01/lib/python3/cmk/base/api/agent_based/register/check_plugins_legacy.py”, line 184, in check_result_generator
is_details = yield from create_new_result(is_details, *subresult)
File “/omd/sites/SITE01/lib/python3/cmk/base/api/agent_based/register/check_plugins_legacy.py”, line 240, in create_new_result
yield Metric(name, value, levels=(warn, crit), boundaries=(min
, max
))
File “/omd/sites/SITE01/lib/python3/cmk/base/api/agent_based/checking_classes.py”, line 216, in new
cls._validate_name(name)
File “/omd/sites/SITE01/lib/python3/cmk/base/api/agent_based/checking_classes.py”, line 238, in _validate_name
raise TypeError(“invalid character(s) in metric name: %r” % offenders)

Local Variables
{‘metric_name’: ‘/’, ‘offenders’: ‘/’, ‘pnp_name’: ‘_’}

Similar on all the other linux hosts.

Thanks,

The / is not a valid metric name any more.

Why would you use check_disk?

Just used to the MRPE method. I have some other scripts running that way.

Is there anything that could be done to resolve the “/” metric name issue?

If I move to the Filesystems (used space and growth) = Setup | Services | Enforced services | Filesystems (used space and growth) method and setup the df mount point “/”, will it discover the other mount points (i.e: /boot, /opt, /home, etc) as well and separate them?

The advantage I see on check_disk way is that I put a simple check like "check_disk -w 25% -c 15% -p /" and it covers all mount points for my linux hosts just fine. No need to group them separately.

Thanks,

The checkmk reports all filesystems which are then discovered automatically in the service discovery phase. There is really no need to use check_disk any more.

Usually you also do not need to use enforced services here as all filesystems are discovered. Enforced services is for situations where you absolutely need a specific service check and cannot rely on automatic service discovery. E.g. you want to have a filesystem /var/data on all database servers and if that does not exist you want to see an alert.

Understood. I must have filesystem discovery disabled (maybe from past when I was using check_disk instead) or not properly set somewhere, because it’s not finding them. I will investigate further.
Thanks,

1 Like

Can you please explain: Did you drop support of nagios plugins? If not, then why doesn’t this one work, exactly? You changed some internal thing … why? What is the work around with the nagios plugin, please?

“There is really no need to use check_disk any more.” … you want to have a filesystem /var/data on all database servers and if that does not exist you want to see an alert.

Exactly.

Also, I’m not sure of the algorithm used there, but you run into problems when mounted filesystems don’t respond properly.

You can use normal Nagios plugins as before. There is nothing changed. Here the problem was that the single ‘/’ as a metric name is not allowed anymore. The forbidden characters for such things are a little bit stricter as before.

As @r.sander wrote in his post it makes no sense inside a CMK environment to use check_disk. The problem with not responding filesystems you have also with the classic check.

1 Like

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.