I am sorry it was a typo i'm tired been on this debugging for a couple
hours. Yes i've fixed the typo but the result is the same.
also done some more logic checking the bash script so i simplified the
checkcommand

> 
> object CheckCommand "check-openvpn" {
>         import "plugin-check-command"
>         import "ipv4-or-ipv6"
> 
>         vars.ip_protocol = ""
>         vars.ip_ports = "-p"
>         vars.ip_port = {{
>                 var tcp = macro("$openvpn_tcp_port$")
>                 var udp = macro("$openvpn_udp_port$")
>                 if (tcp) {
>                         vars.ip_protocol = "-sP"
>                         return tcp
>                 } else {
>                         vars.ip_protocol = "-sU"
>                         return udp
>                 }
>         }}
>         command = [ PluginDir + "/check_openvpn" ]
>         arguments = {
>         "-h" = "$check_address$"
>         "-p" = "$vars.ip_protocol$"
>         "-z" = "$vars.ip_ports$"
>         "-x" = "$vars.ip_port$"
>         }
> 
> }

still only argument passed is check_address. the rest are as if they
don't exist.


On 28/6-June/2015 5:33 PM, Joseph L. Casale wrote:
>>> object CheckCommand "check-openvpn" {
>>>         import "plugin-check-command"
>>>         import "ipv4-or-ipv6"
>>>
>>>         vars.ip_port = ""
>>>         vars.ip_ports = ""
>>>         vars.ip_protocol = {{
>>>                 var tcp = macro("$openvpn_tcp_port$")
>>>                 var udp = macro("$openvpn_udp_port$")
>>>
>>>                 if (tcp) {
>>>                         vars.ip_protocol = "-sP" 
>>>                         vars.ip_port = "-p" 
>>>                         vars.ip_ports = [ "T:" + tcp ]
>>>                         return 
>>>                 } else {
>>>                         vars.ip_protocol = "-sU" 
>>>                         vars.ip_port = "-p" 
>>>                         vars.ip_ports = [ "U:" + udp ]
>>>                         return 
>>>                 }
>>>         }}
>>>         command = [ PluginDir + "/check_openvpn" ]
>>      # would really love to echo $ip_protocol $ip_port etc right about here 
>> or even higher - *somehow*
>>>         arguments = {
>>>         "-h" = "$check_address$"
>>>         "-p" = "$vars.ip_protocol$"
>>>         "-z" = "$vars.ip.port$"
>>>         "-x" = "$vars.ip.ports$"
>>>         }
>>>
>>> }
> 
> Well, the debug log explains actually, it does most certainly show you what
> you are running. Read the docs on params, if the value is not there you have
> not forced out to error.
> 
> ip_ports != ip.ports
> 
> Hth,
> jlc
> _______________________________________________
> icinga-users mailing list
> [email protected]
> https://lists.icinga.org/mailman/listinfo/icinga-users
> 

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to