imtheluckyone / check_mk_emcunity Goto Github PK
View Code? Open in Web Editor NEWCheck_MK Extensions for Dell EMC Unity Storages
License: GNU General Public License v3.0
Check_MK Extensions for Dell EMC Unity Storages
License: GNU General Public License v3.0
I see
File "/omd/sites/dev2/local/share/check_mk/checks/emcunity_fs", line 105, in check_emcunity_fs
status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
when I check for definitions, I see
grep g_hostname *
emcunity_fs: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_lun: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_pool: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_vmfs: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
g_hostname not defined.
grep size_mb *
emcunity_fs: size_mb = int(size_B) / 1024.0 / 1024.0
emcunity_fs: allocated_percent = (allocated_mb / size_mb) * 100
emcunity_fs: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_lun: size_mb = int(size_B) / 1024.0 / 1024.0
emcunity_lun: avail_mb = size_mb - used_mb
emcunity_lun: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_pool: size_mb = int(size_B) / 1024.0 / 1024.0
emcunity_pool: sub_percent = (sub_mb / size_mb) * 100
emcunity_pool: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_vmfs: size_mb = int(size_B) / 1024.0 / 1024.0
emcunity_vmfs: avail_mb = size_mb - used_mb
emcunity_vmfs: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
size_mb defined
grep avail_mb *
emcunity_fs: avail_mb = int(avail_B) / 1024.0 / 1024.0
emcunity_fs: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_lun: avail_mb = size_mb - used_mb
emcunity_lun: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_pool: avail_mb = int(avail_B) / 1024.0 / 1024.0
emcunity_pool: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
emcunity_vmfs: avail_mb = size_mb - used_mb
emcunity_vmfs: status, infotext, perfdata = df_check_filesystem_single(g_hostname, item, size_mb, avail_mb, 0, None, None, params)
avail_mb defined
should g_hostname be defined somewhere ?
Tried to upgrade checkmk from version 2.1.0p32 to 2.2.0p7 and it fails with
OK
Updating core configuration...
Generating configuration for core (type cmc)...
Starting full compilation for all hosts Creating global helper config...OK
Creating cmc protobuf configuration...Configuration Error: Error creating configuration: Traceback (most recent call last):
File "/omd/sites/geomar/lib/python3/cmk/base/cee/microcore_config.py", line 2149, in _hosts_worker
hosts_data = _compute_worker_hosts_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/geomar/lib/python3/cmk/base/cee/microcore_config.py", line 2040, in _compute_worker_hosts_data
return [
^
File "/omd/sites/geomar/lib/python3/cmk/base/cee/microcore_config.py", line 2041, in <listcomp>
helper_config_manager.get_host_data(
File "/omd/sites/geomar/lib/python3/cmk/base/cee/microcore_config.py", line 2916, in get_host_data
return self._compute_and_cache(host_class(hostname, stored_passwords))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/geomar/lib/python3/cmk/base/cee/microcore_config.py", line 2972, in _compute_and_cache
self._write_host_fetcher_config(host.hostname)
File "/omd/sites/geomar/lib/python3/cmk/base/cee/microcore_config.py", line 2977, in _write_host_fetcher_config
fetcher_config.write_local(self._config_path, hostname)
File "/omd/sites/geomar/lib/python3/cmk/base/cee/fetcher_config.py", line 33, in write_local
serialized = fetcher_configuration.fetchers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/geomar/lib/python3/cmk/cee/helpers/fetcher_configuration.py", line 45, in fetchers
"fetchers": [
^
File "/omd/sites/geomar/lib/python3/cmk/cee/helpers/fetcher_configuration.py", line 45, in <listcomp>
"fetchers": [
^
File "/omd/sites/geomar/lib/python3/cmk/cee/helpers/fetcher_configuration.py", line 30, in _unpack
source.fetcher(),
^^^^^^^^^^^^^^^^
File "/omd/sites/geomar/lib/python3/cmk/base/_sources.py", line 389, in fetcher
cmdline=self.config_cache.make_special_agent_cmdline(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/geomar/lib/python3/cmk/base/config.py", line 2789, in make_special_agent_cmdline
args = _make_source_args(
^^^^^^^^^^^^^^^^^^
File "/omd/sites/geomar/lib/python3/cmk/base/config.py", line 2784, in _make_source_args
agent_configuration = info_func(params, hostname, ip_address)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/geomar/local/share/check_mk/checks/agent_emcunity", line 9, in agent_emcunity_arguments
args += " -u " + quote_shell_string(params["username"])
^^^^^^^^^^^^^^^^^^
NameError: name 'quote_shell_string' is not defined
Could not update core configuration. Aborting.
Still younot anymore developing your plugin, this plugin is not useable anymore from checkmk 2.2 . It's some pity, it was helping me a lot.
1 What account does the uemcli queries run as
2 from looking at
more agent_emcunity
#!/usr/bin/env python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2014 [email protected] |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. check_mk is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
# tails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
#
# Written/Edited by Philipp Näther
# [email protected]
import getopt, os, sys, re, subprocess
def usage():
sys.stderr.write("""Check_MK emcunity Agent
USAGE: agent_emcunity [OPTIONS] HOST
agent_emcunity -h
ARGUMENTS:
HOST Hostname or IP address of the target SP
OPTIONS:
-h, --help Show this help message and exit
-u USER, --user USER Set the admin user
-p PASSWORD, --password PASSWORD Set the password for admin user
--debug
it seems even though we have cached the password in the emc bitlocker and can query the unity application passwordless we are using the username and password explicitly for each call. I this correct ( as I working back through the code so could well be wrong )
Agent:
Checks:
general:
emcunity_dpe:
emcunity_pool:
emcunity_vmfs:
emcunity_lun:
emcunity_fs:
Please make possible that we get one Check thats include all HostObjects as MultiLine with the coresponding status.
If one of the Hosts has an Status Warning the complete Check goes to warning.
The Multilineoutput:
Hostname OK
Hostname Warning
Hostname Critical
Get the Status of the Host :
uemcli -d XXX -u ‘XXX’ -p 'XXX' /remote/host show -brief
Some examples :
9: ID = Host_9
Name = XXXX-02
Description =
Tenant =
Type = host
Address =
Netmask =
OS type = Windows Server
Ignored address =
Health state = OK (5)
Health details = "The component is operating normally. No action is required."
8: ID = Host_8
Name = XXXX-01
Description =
Tenant =
Type = host
Address =
Netmask =
OS type = Windows Server
Ignored address =
Health state = Degraded/Warning (10)
Health details = "The host only has one path to the storage system. Add multiple paths between host and storage systems to establish redundancy."
I'm running this against a Unity 450F on Check_MK Enterprise v1.6.0p22 and frequently the service for CPU utilization and Temperature goes unknown for about 15 minutes or so. This happens basically every hour from what I can see. How can I troubleshoot this to identify what the cause is?
Hi,
we upgraded to 1.6 and realized that the check is not running.
2019-10-16 09:33:00,055 [40] [cmk.web 19058] Failed to load plugin
/local/share/check_mk/web/plugins/metrics/emcunity.py: name 'df_translation' is not defined
Traceback (most recent call last):
File "lib/python/cmk/gui/utils.py", line 173, in load_web_plugins
execfile(file_path, globalvars)
File "local/share/check_mk/web/plugins/metrics/emcunity.py", line 4, in
check_metrics["check_mk-emcunity_pool"] = df_translation
I know that is untested but has you any hints for me ?
rg
marcel
We have two shiny new Unity 350F boxes. Monitoring with cmk 1.5p19 is working fine, but the service "Host Connections" crashes all the time. This error is gone after configuring host connections, so this is a very low poriority issue. I will try to fix this in the next week.
cmk crash output
Python Version
2.7.15 (default, Jun 27 2019, 10:06:45) [GCC 8.2.0]
Exception
ValueError (max() arg is an empty sequence)
Traceback
File "/omd/sites/KSC/lib/python/cmk_base/checking.py", line 340, in execute_check raw_result = check_function(item, determine_check_params(params), section_content) File "/omd/sites/KSC/local/share/check_mk/checks/emcunity_hostcons", line 64, in check_emcunity_hostcons (len(cons), max(states))
special agent output
[...]
<<<emcunity_hostcons:sep(61)>>>
<<<emcunity_sp:sep(61)>>>
[...]
Hi, many thanks for your good work with chekc_mk and applicable check for EMC UNITY.
I can confirm conpatibility for Emc Unity 400VL.
I did a small update in the check emcunity_disk, where I have to shift disk by the name, the slot selection was not applicable, because the returned value was not unique.
def inventory_emcunity_disk(info):
keys = [ "Name", "Serial number" ]
disks = emcunity_parse_info(info, keys)
for disk in disks:
if disks[disk]["Serial number"] != "":
item = disks[disk]["Name"]
yield item, None
def check_emcunity_disk(item, params, info):
keys = [ "Name", "Health state", "Health details", "Type", "Model"]
disks = emcunity_parse_info(info, keys)
for disk in disks:
name = disks[disk]["Name"]
if name == item:
hstate = disks[disk]["Health state"]
hdetail = disks[disk]["Health details"]
model = disks[disk]["Model"]
hddtype = disks[disk]["Type"]
return parse_emcstate(hstate), "%s, %s, Model: %s, Type: %s" % (hstate, hdetail, model, hddtype)
check_info["emcunity_disk"] = {
'check_function' : check_emcunity_disk,
'inventory_function' : inventory_emcunity_disk,
'service_description' : 'HW Disk %s',
'includes' : [ 'emcunity.include' ],
}
Hi,
Executing this check in check_mk raw 1.4.0.26 under site user return an error
Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Traceback (most recent call last): File "/omd/sites/traklin/lib/python/site.py", line 73, in <module> __boot() File "/omd/sites/traklin/lib/python/site.py", line 3, in __boot import os ImportError: No module named os
After changing in files
#!/usr/bin/python > #!/usr/bin/env python
The check started to work.
i have just tested this agent on our Unity500 and both emcunity_fs and emcunity_lun return "UNKNOWN - invalid output from agent or error in check implementation"
Hi again.
in Cmk 1.5.0p12
checks:
/omd/sites/traklin/local/share/check_mk/checks/emcunity_pool
/omd/sites/traklin/local/share/check_mk/checks/emcunity_lun
are crashed with exception:
MKGeneralException (Function size_trend not found. Please include "size_trend.include" in your check)
you need to change:
-- [ 'emcunity.include', 'df.include' , 'size_trend.include' ],
++ [ 'emcunity.include', 'size_trend.include', 'df.include' ],
Hello,
is it possible to implement a FC Connection Status Check ?
thx
rg
marcel
Hi,
just tried to work with version 2.2.1 of this check in Check_mk RAW 1.5.0p13 (emcunity-2.2.1.mkp) but is not working, I had to switch to the old version ( emcunity300-1.2.4.mkp )
Hello,
The downloads from EMC have been moved to https://www.dell.com/support/home/de-de/product-support/product/unity-300/drivers.
You will need the keyword search "uem cli" to find the correct downloads.
At the moment it is not possible to find or download the downloads without logging in to the Dell support page.
Maybe you can update these information on your readme.
kind regards
Marcel
when you say
The latest version of the cmk package does not work with cmk versions < 1.6.0.
what specifically is broken ?
Why do I ask ?
Our monitoring team are making threatening noises to migrate to 1.6 and I want to alert them of impact to plugin and effort to fix.
Hi,
one of my pools is degraded caused by a failed drive. But the pool state is still OK, I had expect a WARN state.
Service State: OK
Service Output: OK - 27.87% used (xx of xx TB), trend: +x GB / 24 hours, subscription: 64%, EMC State: Degraded/Warning (10) "The pool is currently degraded, and does not have enough spare space to initiate a rebuild. Replace the faulted drive, or add a drive of the same type and size or larger to the system."
I had a look into the check source, and it does not check the pool state. But this should be checked. According to the docs, the following health states are possible:
My ENV
I am running checkmk on container . According to doc mentioned have to run uemcli on checkmk server so I had to install it on dockercm but could not find uemcli for unity for ubuntu . Can we install uemcli on docker host ?
1- first step is to run uemcli -d hostname -u username -securePassword -sslPolicy store /sys/general show
would you please say what is the next step ?
The check is not running with the new checkMK 2.0
CentOS 7.8.2003 (Core)
When attempting to install the mkp I get the following error:
OMD[prod]:/opt/omd/versions/1.6.0p12.cre/bin$ mkp install /tmp/emcunity-2.2.2.mkp
Traceback (most recent call last):
File "/omd/sites/prod/bin/check_mk", line 94, in
exit_status = modes.call(mode_name, mode_args, opts, args)
File "/omd/sites/prod/lib/python/cmk_base/modes/init.py", line 72, in call
return mode.handler_function(*handler_args)
File "/omd/sites/prod/lib/python/cmk_base/modes/check_mk.py", line 626, in mode_packaging
cmk_base.packaging.do_packaging(*args)
File "/omd/sites/prod/lib/python/cmk_base/packaging.py", line 185, in do_packaging
f(args)
File "/omd/sites/prod/lib/python/cmk_base/packaging.py", line 524, in package_install
return install_package(file_name=path)
File "/omd/sites/prod/lib/python/cmk_base/packaging.py", line 528, in install_package
tar = tarfile.open(name=file_name, fileobj=file_object, mode="r:gz")
File "/omd/sites/prod/lib/python2.7/tarfile.py", line 1693, in open
return func(name, filemode, fileobj, **kwargs)
File "/omd/sites/prod/lib/python2.7/tarfile.py", line 1751, in gzopen
raise ReadError("not a gzip file")
tarfile.ReadError: not a gzip file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.