Re: Wie "sip:status/sip7/connect" bzw. "verbu
RudatNet schrieb:
Das ganze wird wohl mit REQUEST_METHOD="GET" funktionieren!?
Ja, du könntest dir natürlich per GET die Übersichtsseite holen und dann mit grep, sed & Co. solange am Ergebnis herumschnippeln, bis du den gewünschten Wert hast.
Ich habe gerade mal einen anderen Ansatz ausprobiert, und er funktioniert soweit ziemlich gut: Idee: Eine Extra-(Web-)Seite erzeugen, auf der nur die Abfrage des gewünschten Parameters gemacht wird, diese dann durch webcm "ausführen" lassen. Problem dabei ist, dass webcm nur Seiten zulässt, die unterhalb von /usr/www liegen, aber mit ein bisschen mount-Trickserei bekommt man auch dorthin seine Dateien.
Hier mal das Skript als Proof of Concept: "query -i" macht die nötigen mount-Operationen (/var/tmp/tools darf vorher nicht existieren), "query -u" macht alles wieder rückgängig; dazwischen sind der Phantasie kaum Grenzen gesetzt: ;-)
Code:
~ # ./query box:settings/ata_mode
1
~ # ./query box:settings/dns1
192.168.180.2
~ # ./query box:status/localtime
19:49:36 26.11.2005
~ # ./query interfaces:settings/eth0/dhcpclient
1
~ # ./query interfaces:settings/eth0/ipaddr
192.168.178.1
~ # ./query interfaces:settings/eth0/dhcpclient
1
~ # ./query sip:settings/sip0/activated
1
~ # ./query sip:settings/sip2/ID
2
~ # ./query sip:status/sip1/connect
2
~ # ./query telcfg:settings/AlarmClock0/Active
0
~ # ./query wlan:settings/key_value0
373235...
Zum Herumspielen hier eine Liste von Queries, die man in den Dateien des Webinterfaces (14.03.89) finden kann:
Code:
box:settings/ata_mode
box:settings/dhcpclient/use_static_dns
box:settings/dns0
box:settings/dns1
box:settings/dslbridge_if_routing/activated
box:settings/DSLSpeedDownstream
box:settings/DSLSpeedUpstream
box:settings/expertmode/activated
box:settings/fullbridge/activated
box:settings/gateway
box:settings/lanbridge/activated
box:settings/ManualDSLSpeed
box:settings/night_time_control_enabled
box:settings/night_time_control_off_time
box:settings/night_time_control_on_time
box:settings/night_time_control_ring_blocked
box:settings/Statistic/StartOfMonth
box:settings/trafficshaping/activated
box:settings/upnp/activated
box:settings/upnp/control_activated
box:status/hint_dsl_no_cable
box:status/hint_dsl_training
box:status/hint_telefon_message_waiting
box:status/hint_time_budget_reached
box:status/hint_voip_email_message_waiting
box:status/hint_voip_freecall
box:status/hint_voip_voice_message_waiting
box:status/hint_volume_budget_reached
box:status/localtime
connection0:pppoe:settings/idle
connection0:pppoe:settings/mode
connection0:pppoe:settings/password
connection0:pppoe:settings/username
connection0:pppoe:status/connect
connection0:pppoe:status/detail
connection0:pppoe:status/ip
connection0:pppoe:status/uptime
connection0:pppoe:status/voipconnect
connection0:settings/Budget/ConnectionTime
connection0:settings/Budget/Enabled
connection0:settings/Budget/Period
connection0:settings/Budget/VolumeHigh
connection0:settings/Budget/VolumeLow
connection0:settings/Budget/WarnOnly
connection0:settings/ProviderDisconnectPrevention/Enabled
connection0:settings/ProviderDisconnectPrevention/Hour
connection0:settings/type
connection0:settings/VolumeRoundUp/Bytes
connection0:settings/VolumeRoundUp/Enabled
connection0:status/Check/Status
connection0:status/connect
connection_voip:settings/dns_first
connection_voip:settings/dns_second
connection_voip:settings/encapsulation
connection_voip:settings/gateway
connection_voip:settings/ipaddr
connection_voip:settings/netmask
connection_voip:settings/password
connection_voip:settings/use_dhcp
connection_voip:settings/username
connection_voip:settings/use_seperate_vcc
connection_voip:settings/VCI
connection_voip:settings/VPI
ddns:settings/account0/activated
ddns:settings/account0/ddnsprovider
ddns:settings/account0/domain
ddns:settings/account0/iface
ddns:settings/account0/password
ddns:settings/account0/username
emailnotify:settings/accountname
emailnotify:settings/enabled
emailnotify:settings/From
emailnotify:settings/interval
emailnotify:settings/passwd
emailnotify:settings/SMTPServer
emailnotify:settings/To
env:settings/macdsl
env:status/OEM
eth0:status/carrier
eth1:status/carrier
forwardrules:settings/$1/activated
forwardrules:settings/exposed_host
forwardrules:settings/rule/newid
forwardrules:settings/use_exposed_host
forwardrules:settings/$var:rule/activated
forwardrules:settings/$var:rule/description
forwardrules:settings/$var:rule/endport
forwardrules:settings/$var:rule/fwip
forwardrules:settings/$var:rule/fwport
forwardrules:settings/$var:rule/port
forwardrules:settings/$var:rule/protocol
inetstat:status/LastMonth/BytesReceivedHigh
inetstat:status/LastMonth/BytesReceivedLow
inetstat:status/LastMonth/BytesSentHigh
inetstat:status/LastMonth/BytesSentLow
inetstat:status/LastMonth/OutgoingCalls
inetstat:status/LastMonth/PhyConnTimeOutgoing
inetstat:status/LastMonth/VoIPBytesReceivedHigh
inetstat:status/LastMonth/VoIPBytesReceivedLow
inetstat:status/LastMonth/VoIPBytesSentHigh
inetstat:status/LastMonth/VoIPBytesSentLow
inetstat:status/LastWeek/BytesReceivedHigh
inetstat:status/LastWeek/BytesReceivedLow
inetstat:status/LastWeek/BytesSentHigh
inetstat:status/LastWeek/BytesSentLow
inetstat:status/LastWeek/OutgoingCalls
inetstat:status/LastWeek/PhyConnTimeOutgoing
inetstat:status/LastWeek/VoIPBytesReceivedHigh
inetstat:status/LastWeek/VoIPBytesReceivedLow
inetstat:status/LastWeek/VoIPBytesSentHigh
inetstat:status/LastWeek/VoIPBytesSentLow
inetstat:status/ThisMonth/BytesReceivedHigh
inetstat:status/ThisMonth/BytesReceivedLow
inetstat:status/ThisMonth/BytesSentHigh
inetstat:status/ThisMonth/BytesSentLow
inetstat:status/ThisMonth/OutgoingCalls
inetstat:status/ThisMonth/PhyConnTimeOutgoing
inetstat:status/ThisMonth/VoIPBytesReceivedHigh
inetstat:status/ThisMonth/VoIPBytesReceivedLow
inetstat:status/ThisMonth/VoIPBytesSentHigh
inetstat:status/ThisMonth/VoIPBytesSentLow
inetstat:status/ThisWeek/BytesReceivedHigh
inetstat:status/ThisWeek/BytesReceivedLow
inetstat:status/ThisWeek/BytesSentHigh
inetstat:status/ThisWeek/BytesSentLow
inetstat:status/ThisWeek/OutgoingCalls
inetstat:status/ThisWeek/PhyConnTimeOutgoing
inetstat:status/ThisWeek/VoIPBytesReceivedHigh
inetstat:status/ThisWeek/VoIPBytesReceivedLow
inetstat:status/ThisWeek/VoIPBytesSentHigh
inetstat:status/ThisWeek/VoIPBytesSentLow
inetstat:status/timeknown
inetstat:status/Today/BytesReceivedHigh
inetstat:status/Today/BytesReceivedLow
inetstat:status/Today/BytesSentHigh
inetstat:status/Today/BytesSentLow
inetstat:status/Today/OutgoingCalls
inetstat:status/Today/PhyConnTimeOutgoing
inetstat:status/Today/VoIPBytesReceivedHigh
inetstat:status/Today/VoIPBytesReceivedLow
inetstat:status/Today/VoIPBytesSentHigh
inetstat:status/Today/VoIPBytesSentLow
inetstat:status/Total/BytesReceivedHigh
inetstat:status/Total/BytesReceivedLow
inetstat:status/Total/BytesSentHigh
inetstat:status/Total/BytesSentLow
inetstat:status/Total/OutgoingCalls
inetstat:status/Total/PhyConnTimeOutgoing
inetstat:status/Total/VoIPBytesReceivedHigh
inetstat:status/Total/VoIPBytesReceivedLow
inetstat:status/Total/VoIPBytesSentHigh
inetstat:status/Total/VoIPBytesSentLow
inetstat:status/Yesterday/BytesReceivedHigh
inetstat:status/Yesterday/BytesReceivedLow
inetstat:status/Yesterday/BytesSentHigh
inetstat:status/Yesterday/BytesSentLow
inetstat:status/Yesterday/OutgoingCalls
inetstat:status/Yesterday/PhyConnTimeOutgoing
inetstat:status/Yesterday/VoIPBytesReceivedHigh
inetstat:status/Yesterday/VoIPBytesReceivedLow
inetstat:status/Yesterday/VoIPBytesSentHigh
inetstat:status/Yesterday/VoIPBytesSentLow
interfaces:settings/eth0/dhcpclient
interfaces:settings/eth0/dhcpend
interfaces:settings/eth0/dhcpserver
interfaces:settings/eth0/dhcpstart
interfaces:settings/eth0/ipaddr
interfaces:settings/eth0/netmask
interfaces:settings/eth1/dhcpclient
interfaces:settings/eth1/dhcpend
interfaces:settings/eth1/dhcpserver
interfaces:settings/eth1/dhcpstart
interfaces:settings/eth1/ipaddr
interfaces:settings/eth1/netmask
interfaces:settings/usb/dhcpclient
interfaces:settings/usb/dhcpend
interfaces:settings/usb/dhcpserver
interfaces:settings/usb/dhcpstart
interfaces:settings/usb/ipaddr
interfaces:settings/usb/netmask
interfaces:settings/$var:ethnr/dhcpclient
interfaces:settings/$var:ethnr/dhcpserver
interfaces:settings/$var:ethnr/ipaddr
interfaces:settings/$var:ethnr/netmask
interfaces:settings/wlan/dhcpclient
interfaces:settings/wlan/dhcpend
interfaces:settings/wlan/dhcpserver
interfaces:settings/wlan/dhcpstart
interfaces:settings/wlan/ipaddr
interfaces:settings/wlan/netmask
logic:status/nspver
route:settings/$1/activated
route:settings/route/newid
route:settings/$var:route/activated
route:settings/$var:route/gateway
route:settings/$var:route/ipaddr
route:settings/$var:route/netmask
sar:settings/autodetect
sar:settings/dslencap_ether/dns1
sar:settings/dslencap_ether/dns2
sar:settings/dslencap_ether/gateway
sar:settings/dslencap_ether/ipaddr
sar:settings/dslencap_ether/netmask
sar:settings/dslencap_ether/use_dhcp
sar:settings/encapsulation
sar:settings/VCI
sar:settings/VPI
sar:status/ATUC_vendor_ID
sar:status/ATUC_vendor_version
sar:status/bad_hec_cell
sar:status/ds_adaptive
sar:status/ds_atm_data
sar:status/ds_atm_idle
sar:status/ds_attainable
sar:status/ds_attenuation
sar:status/ds_crc
sar:status/ds_delay
sar:status/ds_fec
sar:status/ds_frame_or
sar:status/ds_hec
sar:status/dsl_carrier_state
sar:status/dsl_ds_nrate
sar:status/dsl_ds_rate
sar:status/ds_los
sar:status/dsl_train_state
sar:status/dsl_us_nrate
sar:status/dsl_us_rate
sar:status/ds_margin
sar:status/ds_ncd
sar:status/ds_path
sar:status/DSP_Datapump_ver
sar:status/ds_powercutback
sar:status/ds_rs_or
sar:status/ds_sef
sar:status/ds_status
sar:status/ds_trellis_or
sar:status/exp_ds_B
sar:status/exp_ds_D
sar:status/exp_ds_ifft_fill
sar:status/exp_ds_L
sar:status/exp_ds_M
sar:status/exp_ds_max_delay
sar:status/exp_ds_max_error
sar:status/exp_ds_max_nom_atp
sar:status/exp_ds_max_nom_psd
sar:status/exp_ds_max_rate
sar:status/exp_ds_min_imp
sar:status/exp_ds_min_msg_rate
sar:status/exp_ds_min_rate
sar:status/exp_ds_MSGc
sar:status/exp_ds_nom_psd
sar:status/exp_ds_option
sar:status/exp_ds_R
sar:status/exp_ds_T
sar:status/exp_us_B
sar:status/exp_us_D
sar:status/exp_us_ifft_fill
sar:status/exp_us_L
sar:status/exp_us_M
sar:status/exp_us_max_delay
sar:status/exp_us_max_error
sar:status/exp_us_max_nom_atp
sar:status/exp_us_max_nom_psd
sar:status/exp_us_max_rate
sar:status/exp_us_min_imp
sar:status/exp_us_min_msg_rate
sar:status/exp_us_min_rate
sar:status/exp_us_MSGc
sar:status/exp_us_nom_psd
sar:status/exp_us_option
sar:status/exp_us_R
sar:status/exp_us_T
sar:status/hybrid
sar:status/lastUsCarrier
sar:status/pilot
sar:status/sar_rx_pkt
sar:status/sar_tx_pkt
sar:status/trained_mode
sar:status/us_adaptive
sar:status/us_atm_data
sar:status/us_atm_idle
sar:status/us_attainable
sar:status/us_attenuation
sar:status/us_crc
sar:status/us_delay
sar:status/us_fec
sar:status/us_frame_or
sar:status/us_hec
sar:status/us_los
sar:status/us_margin
sar:status/us_ncd
sar:status/us_path
sar:status/us_powercutback
sar:status/us_rs_or
sar:status/us_sef
sar:status/us_status
sar:status/us_trellis_or
security:settings/password
sipextra:settings/sip/blacklist
sipextra:settings/sip/dyn_codec
sipextra:settings/sip/enum_support_enabled
sipextra:settings/sip/nextID
sipextra:settings/sip/prio_low_codec
sipextra:settings/sip/rtp_prio
sipextra:settings/sip/sip_prio
sipextra:settings/sip/webcm_assi_context
sipextra:settings/VAD/enabled
sip:settings/$1/activated
sip:settings/$1/ID
sip:settings/$1/sipping_enabled
sip:settings/$1/sipping_interval
sip:settings/sip0/activated
sip:settings/sip0/displayname
sip:settings/sip0/password
sip:settings/sip0/registrar
sip:settings/sip0/sipping_enabled
sip:settings/sip0/sipping_interval
sip:settings/sip0/username
sip:settings/sip1/activated
sip:settings/sip1/displayname
sip:settings/sip1/registrar
sip:settings/sip/newid
sip:status/$1/connect
telcfg:settings/$1/Fallback
telcfg:settings/AlarmClock0/Active
telcfg:settings/AlarmClock0/Number
telcfg:settings/AlarmClock0/Time
telcfg:settings/CallThrough/Active
telcfg:settings/CallThrough/CallerID
telcfg:settings/CallThrough/Extension
telcfg:settings/CallThrough/MSN
telcfg:settings/CallThrough/OutgoingMSN
telcfg:settings/CallThrough/PIN
telcfg:settings/CallThrough/Prefix
telcfg:settings/CallThrough/UsePrefix
telcfg:settings/DialPort
telcfg:settings/HotDialEntry/newid
telcfg:settings/HotDialRefresh
telcfg:settings/MSN/MSN0
telcfg:settings/MSN/MSN$0
telcfg:settings/MSN/MSN1
telcfg:settings/MSN/MSN2
telcfg:settings/MSN/MSN3
telcfg:settings/MSN/MSN4
telcfg:settings/MSN/MSN5
telcfg:settings/MSN/MSN6
telcfg:settings/MSN/MSN7
telcfg:settings/MSN/MSN8
telcfg:settings/MSN/MSN9
telcfg:settings/MSN/NTDefault
telcfg:settings/MSN/Port0/Diversion
telcfg:settings/MSN/Port0/DiversionNumber
telcfg:settings/MSN/Port0/MSN0
telcfg:settings/MSN/Port$0/Name
telcfg:settings/MSN/Port0/Name
telcfg:settings/MSN/Port0/RingAllowed
telcfg:settings/MSN/Port1/Diversion
telcfg:settings/MSN/Port1/DiversionNumber
telcfg:settings/MSN/Port1/MSN0
telcfg:settings/MSN/Port1/Name
telcfg:settings/MSN/Port1/RingAllowed
telcfg:settings/MSN/Port2/Diversion
telcfg:settings/MSN/Port2/DiversionNumber
telcfg:settings/MSN/Port2/MSN0
telcfg:settings/MSN/Port2/Name
telcfg:settings/MSN/Port2/RingAllowed
telcfg:settings/MSN/Port3/BusyOnBusy
telcfg:settings/MSN/Port3/CallWaitingProt
telcfg:settings/MSN/Port3/RingAllowed
telcfg:settings/MSN/POTS
telcfg:settings/NTHotDialList/Name$0
telcfg:settings/NTHotDialList/Number$0
telcfg:settings/RefreshJournal
telcfg:settings/Routing/Group/newid
telcfg:settings/Routing/Provider$0
telcfg:settings/Routing/$var:route/Number
telcfg:settings/Routing/$var:route/Provider
telcfg:settings/Routing/$var:route/Route
telcfg:settings/Routing/Version
telcfg:settings/SIP0/MSN
telcfg:settings/SIP0/RegistryType
telcfg:settings/UseClickToDial
telcfg:settings/$var:telnr/KeepLKZPrefix
telcfg:settings/$var:telnr/KeepOKZPrefix
telcfg:settings/$var:telnr/LKZ
telcfg:settings/$var:telnr/LKZPrefix
telcfg:settings/$var:telnr/OKZPrefix
telcfg:settings/$var:telnr/Suffix
telcfg:settings/$var:telnr/UseLKZ
usb:status/carrier
wlan:settings/allowSharedKeyAuth
wlan:settings/ap_enabled
wlan:settings/bg_mode
wlan:settings/channel
wlan:settings/encryption
wlan:settings/hidden_ssid
wlan:settings/interval
wlan:settings/is_macfilter_active
wlan:settings/key_id
wlan:settings/key_len0
wlan:settings/key_len1
wlan:settings/key_len2
wlan:settings/key_len3
wlan:settings/key_value0
wlan:settings/key_value1
wlan:settings/key_value2
wlan:settings/key_value3
wlan:settings/my_wlanmac
wlan:settings/night_time_control_enabled
wlan:settings/power_level
wlan:settings/psktype
wlan:settings/pskvalue
wlan:settings/ssid
wlan:settings/turbomode
wlan:settings/user_isolation
wlan:settings/WDS_enabled
wlan:settings/WDS_encryption
wlan:settings/WDS_hop
wlan:settings/WDS_key
wlan:settings/WDS_mac_master
wlan:settings/WDS_mac_slave0
wlan:settings/WDS_mac_slave1
wlan:settings/WDS_mac_slave2
wlan:settings/WDS_mac_slave3
wlan:settings/wep_auth_type
wlan:status/stat_rx_fcs_err
wlan:status/stat_rx_mcast_msdu
wlan:status/stat_rx_mpdu
wlan:status/stat_rx_msdu
wlan:status/stat_tx_failed_msdu
wlan:status/stat_tx_mcast_msdu
wlan:status/stat_tx_mpdu
wlan:status/stat_tx_msdu
wlan:status/stat_tx_retry
(Der Aufruf von webcm funktioniert so nur, wenn das Web-Passwort abgeschaltet ist oder man durch einen vorherigen POST-Request localhost eingeloggt hat (siehe Beiträge von fritzchen). Das heißt auch, dass die temporär erzeugten Seiten natürlich jeder abrufen kann, der Zugang (evtl. mit Passwort) zum Web-Interface hat.)
Hier das Skript:
Code:
#!/bin/sh
WWW=/usr/www/all/html/tools
VAR=/var/tmp/tools
WEBCM=/usr/www/cgi-bin/webcm
TMP="$WWW/tmp"
case "$1" in
-i) # install: webcm only delivers pages located under /usr/www
mkdir "$VAR" || exit 1
for file in "$WWW"/*; do
base="$(basename "$file")"
touch "$VAR/$base"
mount -o bind "$file" "$VAR/$base"
done
mount -o bind "$VAR" "$WWW"
mkdir "$TMP"
;;
-u) # uninstall
umount "$WWW" "$VAR/"* > /dev/null 2>&1
rm -rf "$VAR"
;;
*) # simple query: write page and use webcm to interpret it
if [ ! -d "$TMP" ]; then
"$0" -i
fi
PAGE="$TMP/$$"
echo "<? query $1 ?>" > "$PAGE"
# assume that 127.0.0.1 is already logged in
REQUEST_METHOD=GET REMOTE_ADDR=127.0.0.1 \
QUERY_STRING="getpage=$PAGE" "$WEBCM" |
sed -e '1,/^$/d'
rm "$PAGE"
;;
esac
Viele Grüße,
buehmann