Hello everyone,
I've been trying Icinga2 for a couple months and I really like the
performance compared to other monitoring software solutions. Also, the
apply rules feature is really awesome!
I'm trying to migrate monitoring records from a Nagios based commercial
solution (Opsview) and I've been stumbling upon some issues since it seems
that there is no easy way to move from this monitoring system into Icinga2.
The usual thing to do is take a monitoring plugin and define a CheckCommand
like:
object CheckCommand "my_custom_mysql_monitoring" {
import "plugin-check-command"
command = [ MyPluginsDir + "/my_custom_mysql_monitoring_plugin" ]
arguments = {
"-H" = {
value = "$my_custom_mysql_hostname$"
description = "the database server's hostname"
}
"-p" = {
value = "$my_custom_mysql_port$"
description = "the database's port"
}
...
}
}
Then create the apply Service rule:
apply Service "my_custom_mysql_backup_status" {
import "generic-service"
check_command = "my_custom_mysql_monitoring"
vars.check_mysql_hostname = "$address$"
vars.check_mysql_port = 3306
vars.check_mysql_conf_file = "my_custom_config_file.cfg"
....
assign where "Backup Slave" in host.vars.purpose
}
So this works great if you have a small amount of plugins and service
checks. But when you have to migrate around 200 scripts all with different
parameters and then add around 2000 service check definitions, things get
quite slow and difficult. I already migrated a few thousand NRPE based
checks using Python scripts, but that was quite "easy" since a generic
check command definition was already enabled in the Icinga configuration.
Is there any way to pass all arguments to a monitoring script as a single
string? Like:
apply Service "mysql_backup_check" {
import "generic-service"
check_command = "my_custom_mysql_monitoring"
vars.my_custom_mysql_monitoring_arguments = "-H $address$ -c
command1 -p port -f config_file"
assign where "Backup Slave" in host.vars.purpose
}
Another question: If you need to add another option to your plugins (for
example, adding the option "-q" to "/my_custom_mysql_monitoring_plugin",
you'll have to add the new custom variable into the check command then add
it again in the apply service definition. Aside any security issues,
shouldn't be easier to pass all arguments "as is" to the plugin and then
let it deal with those?
Thanks in advance,
Rodrigo
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users