mcktr / check_tr64_fritz

Icinga 2 Plugin to check a Fritz!Box
GNU General Public License v2.0
30 stars 10 forks source link

Storing the password #74

Closed thoschworks closed 5 years ago

thoschworks commented 5 years ago
object CheckCommand "check_tr64_fritz" {
  command = [ PluginDir + "/check_tr64_fritz" ]

  arguments = {
    "-h" = "$fritz_host$"
    "-p" = "$fritz_port$"
    "-u" = "$fritz_username$"
    "-P" = "$fritz_password$"
    "-f" = "$fritz_function$"
    "-w" = "$fritz_warning$"
    "-c" = "$fritz_critical$"
  }

  vars.fritz_host = "$address$"
  vars.fritz_port = "49443"
  vars.fritz_username = "dslf-config"
  vars.fritz_function = "status"
}

Where do you store fritz_password?

mcktr commented 5 years ago

You can store the custom variable vars.fritz_password in the host object.

Example:

object Host "router" {
    import "generic-host"
    display_name = "Fritz!Box 7490"
    address = "192.168.178.1"
    vars.fritz_password = "supersecret"
}

apply Service "update" {
    import "generic-service"
    check_command = "check_tr64_fritz"
    vars.fritz_function = "update"
    assign where host.name == "router"
}

For further question regarding to the Icinga 2 configuration, please join the community and ask your question there.