Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_ganglia_metric.sh - adjust for icinga2 #286

Open
bernhardglomm opened this issue Jun 23, 2016 · 1 comment
Open

check_ganglia_metric.sh - adjust for icinga2 #286

bernhardglomm opened this issue Jun 23, 2016 · 1 comment

Comments

@bernhardglomm
Copy link

not a real issue but rather an improvment request (or an hint to evrybody using icinga2):
I want to use "check_ganglia_metric.sh" with icinga2.
Since the config syntax of icinga2 has changed significantly I needed to do the following adjustments to get it working:
tweek check_ganglia_metric.sh:

27,31c27
<       if [[ $ARG =~ .*=$ ]];then
<       CHECK_ARGS=${CHECK_ARGS}"&"${ARG}
<       else
<       CHECK_ARGS=${CHECK_ARGS}${ARG}
<       fi

---
>     CHECK_ARGS=${CHECK_ARGS}"&"${ARG}

in commands.conf add:

object CheckCommand "GangliaCheckShell" {
    import "plugin-check-command"
    command = [ PluginDir + "/check_ganglia_metric.sh" ]
    arguments = {
        "host="               = "$address$"
        "metric_name="  = "$metric$"
        "operator="         = "$operator$"
        "critical_value="  = "$critical$"
    }
}

note the "=" INSIDE the key!

now create gangliachecks.conf with:

// check load_one
apply Service "Ganglia load_one" {
    import "ganglia-service"
    check_command = "GangliaCheckShell"
    vars.metric = "load_one"
    vars.critical = "2"
    vars.operator = "more"
    assign where match ("*" , host.name)
}

in templates.conf you add:

template Service "ganglia-service" {
  max_check_attempts = 2
  check_interval = 1m
  retry_interval = 30s
}

that's it, restart icinga2 and you'll get icinga2 checking via ganglia for a load_one higher than 2

hope that helps

regards

b

@vvuksan
Copy link
Member

vvuksan commented Jul 20, 2016

Can you submit a pull request for this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants