[Icinga-devel] Fwd: Problems with snmp checks in Icinga2 0.0.9 and 0.0.10

Michael Friedrich michael.friedrich at gmail.com
Tue Apr 15 12:15:09 CEST 2014


On 15.04.2014 12:03, Alex Dent wrote:
> Hi Michael,
> thank you for the reply.
>
> Version is:
> root at monitor:/usr/share/icinga2/itl# icinga2 --version
> icinga2 - The Icinga 2 network monitoring daemon. (Version: v0.0.9)
> Copyright (c) 2012-2014 Icinga Development Team (http://www.icinga.org)
> License GPLv2+: GNU GPL version 2 or later
> <http://gnu.org/licenses/gpl2.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> I just got it from the git repo, but I don't think that I got git next
> (How do I get it?)

Add the snapshot repository from packages.icinga.org. the release 
repository doesn't make sense before 2.0.0 anyways.

>
> The cli call is as follows:
>
> root at monitor:/usr/lib/nagios/plugins# ./check_snmp_storage.pl
> <http://check_snmp_storage.pl> -H puppetlab -C nagios -2 -m / -w 80 -c
> 90 -T pu -f
> /home: 29%used(275MB/937MB) /tmp: 2%used(10MB/461MB) /boot:
> 3%used(20MB/685MB) /: 17%used(160MB/937MB) /usr: 21%used(789MB/3752MB)
> /var: 18%used(340MB/1874MB) /dev: 0%used(0MB/10MB) (<80%) : OK |
> '/home'=275MB;750;843;0;937 '/tmp'=10MB;369;415;0;461
> '/boot'=20MB;548;617;0;685 '/'=160MB;750;843;0;937
> '/usr'=789MB;3002;3377;0;3752 '/var'=340MB;1499;1687;0;1874
> '/dev'=0MB;8;9;0;10

first rule: don't test as root.
second rule: always use the full plugin path.


object CheckCommand "snmp-storage" {
         import "plugin-check-command",

         command = [
                 PluginDir + "/check_snmp_storage.pl",
                 "-H", "$HOSTADDRESS$",
                 "-C", SNMPCom,
                 "-2",
                 "-m", "$point$",
                 "-w", "$wdisk$",
                 "-c", "$cdisk$",
                 "-T pu",
                 "-f"
         ],
         macros = {
                 point = "/",
                 opt1 = "FixedDisk",
                 wdisk = "80",
                 cdisk = "90"
         }
}

would translate into

/usr/lib/nagios/plugins/check_snmp_storage.pl -H <address attribute of 
host> -C <snmp community> -2 -m / -w 80 -c 90 -T pu -f

>
>
> This is what I see in the Icinga-Web:
>
> Plugin output
> Usage: check_snmp_storage [-v] -H -C [-2]
>
>
>
> And this is the output from the log files:
>
> Apr 15 12:01:39 monitor icinga2: Executing service check for
> 'puppetlab.wu-wien.ac.at <http://puppetlab.wu-wien.ac.at>!snmp-storage'
> Apr 15 12:01:39 monitor icinga2: Running command
> '/usr/lib/nagios/plugins/check_snmp_storage.pl
> <http://check_snmp_storage.pl> -H xxx.xxx.3.24 -C public -2 -m / -w 80
> -c 90 -T pu -f': PID 13239

-H is not the same as your test (-H puppetlab). Further, -C is not either.

Try to execute that exact command as icinga user and post the result.


> Apr 15 12:01:39 monitor icinga2: Check finished for service
> 'puppetlab.wu-wien.ac.at <http://puppetlab.wu-wien.ac.at>!snmp-storage'
> Apr 15 12:01:39 monitor icinga2: add service check history for
> 'puppetlab.wu-wien.ac.at <http://puppetlab.wu-wien.ac.at>!snmp-storage'
> Apr 15 12:01:39 monitor icinga2: Endpoint node: 'monitor' status update
> for 'puppetlab.wu-wien.ac.at <http://puppetlab.wu-wien.ac.at>!snmp-storage'
> Apr 15 12:01:39 monitor icinga2: Query: UPDATE icinga_servicestatus SET
> acknowledgement_type = '0',  active_checks_enabled = '1',  check_command
> = 'snmp-storage',  check_source = 'monitor',  check_type = '0',
>   current_check_attempt = '1',  current_notification_number = '1435',
>   current_state = '3',  event_handler = '',  event_handler_enabled =
> '0',  execution_time = '0.078319072723388672',  flap_detection_enabled =
> '1',  has_been_checked = '1',  instance_id = 1,  is_flapping = '0',
>   last_check = FROM_UNIXTIME(1397556099),  last_hard_state_change =
> FROM_UNIXTIME(1397126017),  last_notification =
> FROM_UNIXTIME(1397556073),  last_state_change =
> FROM_UNIXTIME(1397125657),  last_time_ok = FROM_UNIXTIME(1397125497),
>   last_time_unknown = FROM_UNIXTIME(1397556099),  latency = '0',
>   long_output = '',  max_check_attempts = '3',
>   modified_service_attributes = '0',  next_check =
> FROM_UNIXTIME(1397556399),  normal_check_interval = '5',
>   notifications_enabled = '1',  output = 'Usage: check_snmp_storage [-v]
> -H <host> -C <snmp_community> [-2] ',  passive_checks_enabled = '1',
>   percent_state_change = '0',  perfdata = '',
>   problem_has_been_acknowledged = '0',  process_performance_data = '1',
>   retry_check_interval = '1',  scheduled_downtime_depth = '0',
>   service_object_id = 19012,  should_be_scheduled = '1',  state_type =
> '1',  status_update_time = FROM_UNIXTIME(1397556099) WHERE
> service_object_id = 19012
>
>
> 2014-04-15 11:54 GMT+02:00 Michael Friedrich
> <michael.friedrich at gmail.com <mailto:michael.friedrich at gmail.com>>:
>
>     On 15.04.2014 11:31, Alex Dent wrote:
>
>         Hi,
>
>         I'm currently trying to implement some of the
>         nagios-snmp-plugins checks
>         in Icinga2. Some I got running, but I'm stuck now with a error
>         where I
>         can't get further. I created a config file for the
>         check_snmp_storage.pl <http://check_snmp_storage.pl>
>         <http://check_snmp_storage.pl> check. When I run the check from the
>
>         commandline with exactly the same flags, everything works as
>         expected,
>         but Icinga sends me the usage output of the check.
>
>
>     And this looks like?
>
>
>
>         I am using Icinga2 0.0.9 and 0.0.10 with Icinga-web 1.11.0. My
>         snmp-storage conf is:
>
>
>     0.0.10 is not yet tagged. Which version are you using?
>
>     # icinga2 --version
>
>
>         object CheckCommand "snmp-storage" {
>                   import "plugin-check-command",
>
>                   command = [
>                           PluginDir + "/check_snmp_storage.pl
>         <http://check_snmp_storage.pl>
>         <http://check_snmp_storage.pl>__",
>                           "-H", "$HOSTADDRESS$",
>
>
>     that macro is $host.address$ in git next.
>
>
>                           "-C", SNMPCom,
>                           "-2",
>                           "-m", "$point$",
>                           "-w", "$wdisk$",
>                           "-c", "$cdisk$",
>                           "-T pu",
>                           "-f"
>                   ],
>                   macros = {
>                           point = "/",
>                           opt1 = "FixedDisk",
>
>
>     This var seems obsolete.
>
>
>                           wdisk = "80",
>                           cdisk = "90"
>                   }
>
>
>     The macros dictionary does not exist anymore in git next, was
>     renamed/merged with 'custom' into 'vars'.
>
>
>         }
>
>         SNMPCom is a global variable.
>
>         Thanks for any replies
>         Alex
>
>
>
>         _________________________________________________
>         icinga-devel mailing list
>         icinga-devel at lists.icinga.org <mailto:icinga-devel at lists.icinga.org>
>         https://lists.icinga.org/__mailman/listinfo/icinga-devel
>         <https://lists.icinga.org/mailman/listinfo/icinga-devel>
>
>
>
>     --
>     DI (FH) Michael Friedrich
>
>     michael.friedrich at gmail.com <mailto:michael.friedrich at gmail.com>  ||
>     icinga open source monitoring
>     https://twitter.com/dnsmichi || lead core developer
>     dnsmichi at jabber.ccc.de <mailto:dnsmichi at jabber.ccc.de>       ||
>     https://www.icinga.org/team
>     irc.freenode.net/icinga <http://irc.freenode.net/icinga>      ||
>     dnsmichi
>     _________________________________________________
>     icinga-devel mailing list
>     icinga-devel at lists.icinga.org <mailto:icinga-devel at lists.icinga.org>
>     https://lists.icinga.org/__mailman/listinfo/icinga-devel
>     <https://lists.icinga.org/mailman/listinfo/icinga-devel>
>
>
>
>
> _______________________________________________
> icinga-devel mailing list
> icinga-devel at lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-devel
>


-- 
DI (FH) Michael Friedrich

michael.friedrich at gmail.com  || icinga open source monitoring
https://twitter.com/dnsmichi || lead core developer
dnsmichi at jabber.ccc.de       || https://www.icinga.org/team
irc.freenode.net/icinga      || dnsmichi


More information about the icinga-devel mailing list