123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?xml version="1.0" encoding="UTF-8"?>
- <CLISH_MODULE xmlns="http://clish.sourceforge.net/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema
- http://clish.sourceforge.net/XMLSchema/clish.xsd">
-
- <VIEW name="ping-view"
- prompt="${SYSTEM_NAME}# ">
- <COMMAND name="ping"
- help="Send echo messages">
- <PARAM name="ip"
- help="IP echo"
- ptype="SUBCOMMAND"
- mode="subcommand"
- optional="true"/>
- <PARAM name="dst"
- help="Ping destination address or hostname"
- ptype="STRING"/>
- <PARAM name="resolve"
- help="Resolve names"
- ptype="SUBCOMMAND"
- mode="subcommand"
- optional="true"/>
- <PARAM name="broadcast"
- help="Ping broadcast address"
- ptype="SUBCOMMAND"
- mode="subcommand"
- optional="true"/>
- <PARAM name="repeat"
- help="Specify repeat count"
- optional="true"
- mode="subcommand"
- ptype="SUBCOMMAND">
- <PARAM name="count"
- help="Repeat count"
- default="5"
- ptype="UINT"/>
- </PARAM>
- <PARAM name="size"
- help="Specify datagram size"
- optional="true"
- mode="subcommand"
- ptype="SUBCOMMAND">
- <PARAM name="psize"
- help="Datagram size"
- ptype="UINT"/>
- </PARAM>
- <PARAM name="source"
- help="Specify source address or name"
- optional="true"
- mode="subcommand"
- ptype="SUBCOMMAND">
- <PARAM name="src"
- help="Interface name or IP-address"
- ptype="STRING"/>
- </PARAM>
- <PARAM name="packet_interval"
- value="interval"
- help="Specify interval between packets"
- optional="true"
- ptype="SUBCOMMAND">
- <PARAM name="interval"
- help="Interval beetween packets"
- default="2"
- ptype="UINT"/>
- </PARAM>
- <PARAM name="flood"
- help="Flood ping"
- ptype="SUBCOMMAND"
- mode="subcommand"
- optional="true"/>
- <ACTION>
- cmd="ping ${dst}"
- # Resolve names
- if [[ ! -n "${resolve}" ]]; then
- cmd=$cmd" -n"
- fi
- # Ping broadcast
- if [[ -n "${broadcast}" ]]; then
- cmd=$cmd" -b"
- fi
- # Ping from interface or address
- cmd=$cmd"${ -I :src}"
- # Packets count
- if [[ ! -n "${count}" ]]; then
- cmd=$cmd" -c 5"
- else
- cmd=$cmd"${ -c :count}"
- fi
- # Packet size
- cmd=$cmd"${ -s :psize}"
- # Interval between packets
- if [[ ! -n "${interval}" ]]; then
- cmd=$cmd" -i 2"
- else
- cmd=$cmd"${ -i :interval}"
- fi
- # Flood ping
- if [[ -n "${flood}" ]]; then
- cmd=$cmd" -f"
- fi
- # Change it to exec or...
- $cmd
- </ACTION>
- </COMMAND>
- <COMMAND name="traceroute"
- help="Trace route to destination"
- lock="false">
- <PARAM name="ip"
- help="IP trace"
- ptype="STRING"
- mode="subcommand"
- optional="true"/>
- <PARAM name="addr"
- help="Trace route to destination address or hostname"
- ptype="STRING"/>
- <ACTION>
- traceroute ${addr}
- </ACTION>
- </COMMAND>
- </VIEW>
- </CLISH_MODULE>
|