I’m working on becoming more and more familiar with the check_mk plugin system. One that I’m trying to figure out in specific is Veritas Cluster Server, and not in a traditional usage pattern either.
I’m trying to implement the Veritas Cluster Server check on a Solaris server in our environment. According to the check_mk page, the check only works in Linux, but the commands/location/everything are the same on the Solaris box as they would be on an equivalent Linux server.
When I attempt to add the check, check_mk complains that it’s missing the plugin “veritas_vcs”. I do not see this plug in anywhere on the check_mk server, but I do see that lines for veritas_vcs are embedded in the check_mk_agent script that runs on the Linux client.
In order to try and make this check “Solaris compatible”, would I just need to copy/paste the lines from the linux check_mk_agent into the Solaris check_mk_agent and re-run it to see what happens, or is there a file I should be dropping into /usr/lib/check_mk_agent/plugins that I am just not seeing somewhere?
Learned a lot in the past couple of hours, and should add some extra context too!
We’re currently using 1.5p16, but the agent I was using was 1.5p9 based on when we first rolled this out to the environment as a whole. When I first copied the lines into the check_mk_agent we had there, pretty much at the end of the file (past the “ps” section), it never even ran.
We discovered a syntax error just before that which was causing the entire script to fail at that point and was also causing us not to get a good chunk of tests! When we updated the script to a “factory” 1.5p16, it worked, and then when we added the VCS cluster lines in question to the end of that script we also saw output in check_mk. Big step in the right direction.
This has exposed a new error though. On check_mk_discovery, under the host --> WATO --> Save & Go To Services (performing a discovery), I get this error:
Service discovery failed for this host: Got invalid data:
local variable ‘cluster_name’ referenced before assignment
Retry discovery while ignoring this error (Result might be incomplete).
Any idea what to make of this error? I don’t see any sort of cluster_name variable in the agent script.
OMD[bo3master]:~$ cmk --debug -vv --check-discovery cdb0.dc1.prod
Updating IPv4 DNS cache for cdb0.dc1.prod: 10.47.56.50
FETCHING DATA
[agent] No persisted sections loaded
[agent] Not using cache (Does not exist)
[agent] Execute data source
[agent] Connecting via TCP to 10.47.56.50:6556 (5.0s timeout)
[agent] Reading data from agent
[agent] Write data to cache file /omd/sites/bo3master/tmp/check_mk/cache/cdb0.dc1.prod
[piggyback] No persisted sections loaded
[piggyback] Execute data source
Traceback (most recent call last):
File “/omd/sites/bo3master/bin/cmk”, line 96, in
exit_status = modes.call(o, a, opts, args)
File “/omd/sites/bo3master/lib/python/cmk_base/modes/init.py”, line 80, in call
return mode.handler_function(*handler_args)
File “/omd/sites/bo3master/lib/python/cmk_base/modes/check_mk.py”, line 1412, in mode_check_discovery
return discovery.check_discovery(hostname, ipaddress=None)
File “/omd/sites/bo3master/lib/python/cmk_base/checking.py”, line 81, in wrapped_check_func
status, infotexts, long_infotexts, perfdata = check_func(hostname, *args, **kwargs)
File “/omd/sites/bo3master/lib/python/cmk_base/discovery.py”, line 322, in check_discovery
services = _get_host_services(hostname, ipaddress, sources, multi_host_sections, on_error=“raise”)
File “/omd/sites/bo3master/lib/python/cmk_base/discovery.py”, line 1018, in _get_host_services
return _get_node_services(hostname, ipaddress, sources, multi_host_sections, on_error)
File “/omd/sites/bo3master/lib/python/cmk_base/discovery.py”, line 1023, in _get_node_services
services = _get_discovered_services(hostname, ipaddress, sources, multi_host_sections, on_error)
File “/omd/sites/bo3master/lib/python/cmk_base/discovery.py”, line 1061, in _get_discovered_services
new_items = _discover_services(hostname, ipaddress, sources, multi_host_sections, on_error)
File “/omd/sites/bo3master/lib/python/cmk_base/discovery.py”, line 715, in _discover_services
for item, paramstring in _execute_discovery(multi_host_sections, hostname, ipaddress, check_plugin_name, on_error):
File “/omd/sites/bo3master/lib/python/cmk_base/discovery.py”, line 914, in _execute_discovery
check_plugin_name, for_discovery=True)
File “/omd/sites/bo3master/lib/python/cmk_base/data_sources/host_sections.py”, line 146, in get_section_content
nodes_of_clustered_service)
File “/omd/sites/bo3master/lib/python/cmk_base/data_sources/host_sections.py”, line 204, in _get_section_content
section_content = self._update_with_parse_function(section_content, section_name)
File “/omd/sites/bo3master/lib/python/cmk_base/data_sources/host_sections.py”, line 299, in _update_with_parse_function
return parse_function(section_content)
File “/omd/sites/bo3master/share/check_mk/checks/veritas_vcs”, line 167, in parse_veritas_vcs
section.setdefault(item_name, ).append(Vcs(node, attr, value, cluster_name))
UnboundLocalError: local variable ‘cluster_name’ referenced before assignment