0

I would migrate from Nagios to Icinga2. I would try to migrate one my custom command that works in Nagios but i can't translate in Icinga. I would create one my custom "object CheckCommand" to use in some hosts.

In nagios I have this (and still work if I execute on new Icinga2 server from shell)

./check_by_ssh -H myHostName -t 15 -l myLoginUsername -C "/opt/jboss/scripts/check_file_size.sh --maxwarn 80000000 --maxcrit 150000000 /opt/jboss/domain/servers/*/log/* /opt/jboss/domain/log/*" -E

Due to multiple level of parameter (parameter of check_by_ssh and parameter of check_file_size_ssh) I can not write the right "object CheckCommand" and "object Host" or "Apply Service".

Can someone help me?

Best reagrds

barbatrukko
  • 51
  • 1
  • 3

1 Answers1

0

Try the following, adjust as necessary. Afaik the arguments can be specified as array and will be put together.

apply Service "ssh-check"  {
  import "generic-service"
  check_command = "by_ssh"

   vars.by_ssh_address = host.address
   vars.by_ssh_command = "/opt/jboss/scripts/check_file_size.sh"
   vars.by_ssh_logname = "myLoginUserName"

   vars.by_ssh_arguments += [ "--maxwarn" ]
   vars.by_ssh_arguments += [ "80000000"  ]
   vars.by_ssh_arguments += [ "--maxcrit"  ]
   vars.by_ssh_arguments += [ "150000000" ]
   vars.by_ssh_arguments += [ "/opt/jboss/domain/servers/*/log/*"  ]
   vars.by_ssh_arguments += [ "/opt/jboss/domain/log/*" ]

}
kovalsky
  • 26
  • 4