Giter Club home page Giter Club logo

check_mk_emcunity's People

Contributors

goam03 avatar imtheluckyone avatar pdcemulator avatar yogibaer75 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

check_mk_emcunity's Issues

g_hostname variable not defined ?

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 ?

Not compatible with checkmk 2.2

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.

what does uemccli run as

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 )

ToDo

Agent:

  • implement WATO ruleset to get rid of command line call and pass user and password via variables

Checks:

general:

  • redesign the iterating over the agent output

emcunity_dpe:

  • make use of temperature and power consumption output

emcunity_pool:

  • implement own checkgroup and default_levels

emcunity_vmfs:

  • implement own checkgroup and default_levels

emcunity_lun:

  • implement own checkgroup and default_levels

emcunity_fs:

  • implement own checkgroup and default_levels

Host Object Support (Degreaded/Warning)

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."

monitors for one of the SP's goes "UNKNOWN" frequently

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?

CMK 1.6

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

Service check Host Connection crashes if there are no host connections

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)>>>
[...]

EMC UNITY 400VL

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):

parse info, no key needed for inventory

"Name" is automatically added

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):

parse info, just get data we want for this check by defining the keys

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' ],
}

python path in files

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.

MKGeneralException (Function size_trend not found. Please include "size_trend.include" in your check)

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' ],

FC-Connection Status

Hello,

is it possible to implement a FC Connection Status Check ?

thx
rg
marcel

Version 2.2.1 not working on check_mk 1.5.0p13

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 )

1.6 not supported ?

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.

degraded pool / still in OK state

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:

  • Unknown (0) — Status is unknown.
  • OK (5) — Working correctly.
  • OK BUT (7) — Working correctly, but there could be a problem.
  • Degraded/Warning (10) — Working and performing all functions, but the performance may not be optimum.
  • Minor failure (15) — Working and performing all functions but overall performance is degraded. This condition has a minor * impact on the system and should be remedied at some point, but does not have to be fixed immediately.
  • Major failure (20) — Failing and some or all functions may be degraded or not working. This condition has a significant impact * on the system and should be remedied immediately.
  • Critical failure (25) — Failed and recovery may not be possible. This condition has resulted in data loss and should be remedied immediately.
  • Non-recoverable error (30) — Completely failed and cannot be recovered.

My ENV

  • cmk EE 1.6p13
  • EMC Unity 350F 5.0.0.0.5.116
  • cmk_emcunity 2.2.2

UEMCLI when checkmk is running on container

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 ?

Attempting to install 2.2.2 on cmk 1.6.0p12 results in failure

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.