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

Fix additional addresses in check_icmp #416

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions checks/check_icmp
Expand Up @@ -39,30 +39,30 @@ def check_icmp_arguments(params):
args.append("$HOSTALIAS$")

elif target == "all_ipv4addresses":
args += ["$HOST_ADDRESSES_4$", "$HOST_ADDRESS_4$"]
args += ["$_HOSTADDRESSES_4$", "$_HOSTADDRESS_4$"]

elif target == "all_ipv6addresses":
args += ["-6", "$HOST_ADDRESSES_6$", "$HOST_ADDRESS_6$"]
args += ["-6", "$_HOSTADDRESSES_6$", "$_HOSTADDRESS_6$"]

elif target == "additional_ipv4addresses":
args.append("$HOST_ADDRESSES_4$")
args.append("$_HOSTADDRESSES_4$")

elif target == "additional_ipv6addresses":
args += ["-6", "$HOST_ADDRESSES_6$"]
args += ["-6", "$_HOSTADDRESSES_6$"]

elif target[0] == "indexed_ipv4address":
args.append("$HOST_ADDRESS_4_%s$" % target[1])
args.append("$_HOSTADDRESS_4_%s$" % target[1])

elif target[0] == "indexed_ipv6address":
args.append("$HOST_ADDRESS_6_%s$" % target[1])
args.append("$_HOSTADDRESS_6_%s$" % target[1])

else: # custom
args.append(str(target[1]))

# Unfortunately, we must return a single string here.
# Otherwise shell quoting will be applied to every element
# of the list, which will interfere with macro replacements like
# "$HOST_ADDRESSES_4$" -> "1.2.3.4 5.6.7.8"
# "$_HOSTADDRESSES_4$" -> "1.2.3.4 5.6.7.8"
return " ".join(args)


Expand Down