Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

zenoss core 4, seems to have trouble when there is more than 2 fields separated by "|" (pipe... #1

Open
wants to merge 1 commit into from

1 participant

peshovec
peshovec

...s) in the command output

so filter the third one

before:
/opt/zenoss/libexec/check_ping -H 8.8.8.8 -w 180,100% -c 300,100% | sed -e 's# - Packet loss#|LOSS#;s#%,##;s#ms##;s# = #=#g'
PING OK|LOSS=0 RTA=31.38 |rta=31.384001ms;180.000000;300.000000;0.000000 pl=0%;100;100;0

after:
/opt/zenoss/libexec/check_ping -H 8.8.8.8 -w 180,100% -c 300,100% | sed -e 's# - Packet loss#|LOSS#;s#%,##;s#ms##;s# = #=#g;s#|rta=.*$##'
PING OK|LOSS=0 RTA=31.44

p.s. the used '$' has to be repeated, elsewhere the zenoss command parser cannot escape it properly

peshovec peshovec zenoss core 4, seems to have trouble when there is more than 2 "|" (p…
…ipes) in the command output

so filter the third one

before:
/opt/zenoss/libexec/check_ping -H 8.8.8.8 -w 180,100% -c 300,100% | sed -e 's# - Packet loss#|LOSS#;s#%,##;s#ms##;s# = #=#g'
PING OK|LOSS=0 RTA=31.38 |rta=31.384001ms;180.000000;300.000000;0.000000 pl=0%;100;100;0


after:
/opt/zenoss/libexec/check_ping -H 8.8.8.8 -w 180,100% -c 300,100% | sed -e 's# - Packet loss#|LOSS#;s#%,##;s#ms##;s# = #=#g;s#|rta=.*$##'
PING OK|LOSS=0 RTA=31.44

p.s. the used '$' has to be repeated, elsewhere the zenoss command parser cannot escape it properly
bfb1ec2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 20, 2012
  1. peshovec

    zenoss core 4, seems to have trouble when there is more than 2 "|" (p…

    peshovec authored
    …ipes) in the command output
    
    so filter the third one
    
    before:
    /opt/zenoss/libexec/check_ping -H 8.8.8.8 -w 180,100% -c 300,100% | sed -e 's# - Packet loss#|LOSS#;s#%,##;s#ms##;s# = #=#g'
    PING OK|LOSS=0 RTA=31.38 |rta=31.384001ms;180.000000;300.000000;0.000000 pl=0%;100;100;0
    
    
    after:
    /opt/zenoss/libexec/check_ping -H 8.8.8.8 -w 180,100% -c 300,100% | sed -e 's# - Packet loss#|LOSS#;s#%,##;s#ms##;s# = #=#g;s#|rta=.*$##'
    PING OK|LOSS=0 RTA=31.44
    
    p.s. the used '$' has to be repeated, elsewhere the zenoss command parser cannot escape it properly
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  ZenPacks/Nagios/CheckPing/objects/objects.xml
2  ZenPacks/Nagios/CheckPing/objects/objects.xml
View
@@ -20,7 +20,7 @@ True
3
</property>
<property type="string" id="commandTemplate" mode="w" >
-check_ping -H $devname -w 180,100% -c 300,100% | sed -e 's# - Packet loss#|LOSS#;s#%,##;s#ms##;s# = #=#g'
+check_ping -H $devname -w 180,100% -c 300,100% | sed -e 's# - Packet loss#|LOSS#;s#%,##;s#ms##;s# = #=#g;s#|rta=.*$$##'
</property>
<property type="int" id="cycletime" mode="w" >
300
Something went wrong with that request. Please try again.