> On 17 Mar 2016, at 15:00, Ben Schmidt <[email protected]> wrote:
>
> 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.

Probably a bug in the migration script. Though we’ve seen many users trying to 
configure Icinga 2 the old-fashioned way like Nagios did, and therefore missing 
all the advantages Icinga 2 is able to provide. I would not recommend to go the 
route of such a migration script.

Instead, do an inventory of your existing configuration items and look for

1) existing CheckCommand definitions provided by the ITL
2) write a proper CheckCommand if it does not exist (use command arguments, 
make it generic with optional arguments, but skip those crappy ARG1 to ARG999 
non-telling arguments)
3) think about common patterns for your hosts adding for example custom 
attributes
4) apply services based on these patterns
5) add hosts to host groups based on these patterns
6) reconsider how notifications worked the old way - multiple contacts for 
hosts/services - and re-create notification apply rules for hosts/services in 
Icinga 2, adding your user/user_groups to it

More hints on the documentation itself, be it the migration related one, or 
monitoring basics.

Sooner or later I’ll remove the migration script from git. Even if it did cost 
multiple nights and weekends to code it, the outcome isn’t satisfying compared 
to what we are able to accomplish using the Icinga 2 dsl.

Kind regards,
Michael

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


-- 
Michael Friedrich, DI (FH)
Senior Developer

NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
CEO: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | [email protected]

** OSDC 2016 - April - netways.de/osdc **
** OSBConf 2016 - September - osbconf.org **
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to