check_mk-plugins
check_mk-plugins copied to clipboard
notify-via-isms: URL encode when % is on the end of message - message sending fails
My solution:
sub urlencode { my $str = "@"; $str =~ s/%([A-Fa-f\d]{2})/chr hex $1/eg; # decode first, there are new lines encoded by checkmk $str =~ s/([^^A-Za-z0-9-.~])/ sprintf "%%%02X", ord $1 /eg; # encode also % character !!! return $str; }