Hi Mailing List, I am pretty new to icinga2, I just started yesterday by trying to migrate a nagios3 config to icinga2. So far I used the migrate script and figured out everything that didn't work by myself but I am stuck with one check that won't work.
Here is what I am running ############ [root@bs52-nm06 /usr/lib/nagios/plugins $ icinga2 -V icinga2 - The Icinga 2 network monitoring daemon (version: r2.4.3-1) Copyright (c) 2012-2016 Icinga Development Team (https://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. Application information: Installation root: /usr Sysconf directory: /etc Run directory: /run Local state directory: /var Package data directory: /usr/share/icinga2 State path: /var/lib/icinga2/icinga2.state Modified attributes path: /var/lib/icinga2/modified-attributes.conf Objects path: /var/cache/icinga2/icinga2.debug Vars path: /var/cache/icinga2/icinga2.vars PID path: /run/icinga2/icinga2.pid System information: Platform: Debian GNU/Linux Platform version: 8 (jessie) Kernel: Linux Kernel version: 4.2.8-1-pve Architecture: x86_64 [root@bs52-nm06 /usr/lib/nagios/plugins $ lsb_release -a | grep Description Description: Debian GNU/Linux 8.3 (jessie) ############ This check is giving me a headache ############ apply Service "jmx_GC_ConcurrentMarkSweep" to Host { import "service-template-interval-5min" enable_notifications = 0 check_command = "check_jmx" vars.ARG1 = "tomcat" vars.ARG2 = "10" vars.ARG3 = "9003" vars.ARG4 = "java.lang:type=GarbageCollector,name=ConcurrentMarkSweep -A LastGcInfo -K duration -w 18000 -c 24000 -u ms" #vars.ARG4 = "\"java.lang:type=GarbageCollector,name=ConcurrentMarkSweep\" " #vars.ARG5 = " -A LastGcInfo -K duration -w 18000 -c 24000 -u ms" assign where "jmx_garbagecollection_concurrentmarksweep" in host.groups } object CheckCommand "check_jmx" { import "migration-check-command" import "plugin-check-command" command = PluginDir + "/check_by_ssh -t $ARG2$ -l $ARG1$ -H $address$ -C '/home/tomcat/nagios_plugins_nonstandart/check_jmx -U service:jmx:rmi:/// jndi/rmi://localhost:9003/jmxrmi -O $ARG4$ '" } ############ If I run the check manually everything works as expected: ############ nagios@bs52-nm06:~$ /usr/lib/nagios/plugins/check_by_ssh -t 10 -l tomcat -H 10.*.*.* -C '/home/tomcat/nagios_plugins_nonstandart/check_jmx -U service: jmx:rmi:///jndi/rmi://localhost:9003/jmxrmi -O java.lang:type= GarbageCollector,name=ConcurrentMarkSweep -A LastGcInfo -K duration -w 18000 -c 24000 -u ms ' JMX OK - LastGcInfo.duration = 769ms | 'LastGcInfo duration'=769ms;18000;24000;; ############ The error message I get is: ############ /usr/lib/nagios/plugins/check_by_ssh: invalid option -- 'A' Usage: check_by_ssh -H <host> -C <command> [-fqv] [-1 [-S [lines]] [-E [lines]] [-t timeout] [-i identity] [-l user] [-n name] [-s servicelist] [-O outputfile] [-p port] [-o ssh-option] [-F configfile] ############ So far I know that my error is inside the remote part of the check command. Everything works if I setup the CheckCommand like this ############# object CheckCommand "check_jmx" { import "migration-check-command" import "plugin-check-command" command = PluginDir + "/check_by_ssh -t $ARG2$ -l $ARG1$ -H $address$ -C '/home/tomcat/nagios_plugins_nonstandart/check_jmx -U service:jmx:rmi:/// jndi/rmi://localhost:9003/jmxrmi -O java.lang:type=GarbageCollector,name= ConcurrentMarkSweep -A LastGcInfo -K duration -w 18000 -c 24000 -u ms ' " } ############# Could someone please point me to what I a doing wrong? Thanks a lot, Ben
_______________________________________________ icinga-users mailing list [email protected] https://lists.icinga.org/mailman/listinfo/icinga-users
