* [sisyphus] NeTAMS Ошибки передачи параметров скрипту (access-script)
@ 2004-07-23 16:20 Aleksey Avdeev
0 siblings, 0 replies; only message in thread
From: Aleksey Avdeev @ 2004-07-23 16:20 UTC (permalink / raw)
To: ALT Linux Sisyphus discussion list
[-- Attachment #1: Type: text/plain, Size: 5556 bytes --]
Здравствуйте.
Пробую задействовать NeTAMS (netams-3.1.1829-alt1) для управления
squid (через access-script). Но при вызове скрипта - демон падает
(если параметр access-script закоминтировать - всё работает).
В процессе отладки обнаружил, что скрипту передаются повидимому
"грязные" параметры (содержат странные символы).
Скрипт (action.sh он довольно сырой) лог работы его работы
(action.log) прилагаю.
Выдержка netams.log, участок старт-падение (при включенной отладке):
++++++
NeTAMS version 3.1(1829.1) builder@mash / Mon Jul 5 13:41:15 MSD 2004
23.07.2004 20:10:33.2049 main [INFO]: Becoming a daemon...
23.07.2004 20:10:33.2153 scheduler [INFO]: service scheduler:0
thread started
23.07.2004 20:10:33.2154 main [INFO]: service scheduler starting
thread...
23.07.2004 20:10:33.2157 main [INFO]: scheduled to: 23.07.2004 20:59:50
23.07.2004 20:10:33.2157 scheduler [INFO]: service scheduler:0
processing queue
23.07.2004 20:10:33.2158 main [INFO]: service server starting thread...
23.07.2004 20:10:33.2158 main [INFO]: service server:0 initialized
23.07.2004 20:10:33.2158 main [INFO]: server login permitted from
localhost only
23.07.2004 20:10:33.2159 main [INFO]: server listen port set to 20001
23.07.2004 20:10:33.2159 main [INFO]: server maximum connections
number is set to 2
23.07.2004 20:10:33.2159 server [INFO]: service server thread started
23.07.2004 20:10:33.2159 <..> [INFO]: service storage:1 thread
started (0x8096290)
23.07.2004 20:10:33.2160 main [INFO]: service storage starting thread...
23.07.2004 20:10:33.2160 main [INFO]: service storage:1 initialized
23.07.2004 20:10:33.2161 <..> [INFO]: service data-source:0 thread
started (0x8096500)
23.07.2004 20:10:33.2161 main [INFO]: service data-source starting
thread...
23.07.2004 20:10:33.2161 main [INFO]: service data-source:0 initialized
23.07.2004 20:10:33.2162 main [INFO]: service data-source starting
thread...
23.07.2004 20:10:33.2162 main [INFO]: service data-source:1 initialized
23.07.2004 20:10:33.2163 main [INFO]: service monitor starting thread...
23.07.2004 20:10:33.2163 main [INFO]: service monitor:1 initialized
23.07.2004 20:10:33.2164 data-source [INFO]: service data-source:1
thread started (0x80966c0)
23.07.2004 20:10:33.2164 <..> [INFO]: service processor thread started
23.07.2004 20:10:33.2164 main [INFO]: service processor starting
thread...
23.07.2004 20:10:33.2164 main [INFO]: service processor:0 initialized
23.07.2004 20:10:33.2340 <..> [INFO]: service html:0 thread started
(0x80e2018)
23.07.2004 20:10:33.2341 main [INFO]: service html starting thread...
23.07.2004 20:10:33.2341 main [INFO]: service html:0 initialized
23.07.2004 20:10:33.2342 main [INFO]: service html starting thread...
23.07.2004 20:10:33.2342 main [INFO]: service html:1 initialized
23.07.2004 20:10:33.2343 html [INFO]: service html:1 thread started
(0x80e20c0)
23.07.2004 20:10:33.2343 <..> [INFO]: service alerter:0 thread
started (0x80e2168)
23.07.2004 20:10:33.2343 main [INFO]: service alerter starting thread...
23.07.2004 20:10:33.2343 main [INFO]: service alerter:0 initialized
23.07.2004 20:10:33.2344 <..> [INFO]: service quota:0 thread started
(0x80e22f0)
23.07.2004 20:10:33.2344 main [INFO]: service quota starting thread...
23.07.2004 20:10:33.2345 main [INFO]: service quota:0 initialized
23.07.2004 20:10:33.2346 main [INFO]: service login starting thread...
23.07.2004 20:10:33.2346 main [INFO]: service login:0 initialized
23.07.2004 20:10:33.2346 login [INFO]: service login:0 thread
started (0x80e2598)
23.07.2004 20:10:34.2379 main [INFO]: wake up main:0 service: SKIPPED!
23.07.2004 20:10:34.2380 main [INFO]: waking up scheduler:0 service:
WAS_DOWN
23.07.2004 20:10:34.2380 main [INFO]: waking up server:0 service:
WAS_DOWN
23.07.2004 20:10:34.2380 main [INFO]: waking up storage:1 service:
WAS_DOWN
23.07.2004 20:10:34.2381 main [INFO]: waking up data-source:0
service: WAS_DOWN
23.07.2004 20:10:34.2381 main [INFO]: waking up data-source:1
service: WAS_DOWN
23.07.2004 20:10:34.2381 main [INFO]: waking up monitor:1 service:
WAS_UP
23.07.2004 20:10:34.2381 main [INFO]: waking up processor:0 service:
WAS_DOWN
23.07.2004 20:10:34.2381 main [INFO]: waking up html:0 service: WAS_DOWN
23.07.2004 20:10:34.2382 main [INFO]: waking up html:1 service: WAS_DOWN
23.07.2004 20:10:34.2382 main [INFO]: waking up alerter:0 service:
WAS_DOWN
23.07.2004 20:10:34.2382 main [INFO]: waking up quota:0 service:
WAS_DOWN
23.07.2004 20:10:34.2382 main [INFO]: waking up login:0 service:
WAS_DOWN
23.07.2004 20:10:34.2382 main [INFO]: NeTAMS is now operational,
23.07.2004 20:10:34
23.07.2004 20:10:34.2383 server [INFO]: server is listening
23.07.2004 20:10:34.2384 storage [INFO]: storage:1 working with SQL
23.07.2004 20:10:34.2385 data-source [WARN]: no rule for pcap,
capturing all
23.07.2004 20:10:34.2386 data-source [INFO]: Libpcap: ethernet interface
23.07.2004 20:10:34.2386 data-source [INFO]: Hook is installed by ds:0
23.07.2004 20:10:34.2389 data-source [INFO]: Hook is installed by ds:1
23.07.2004 20:10:34.2391 processor [INFO]: using storage:1,
in=0x80962c8, out=0x8096308, service_cfg=0x8096290
23.07.2004 20:10:34.2391 processor [INFO]: using storage:1 as source
for READ and STAT requests
23.07.2004 20:10:34.2414 alerter [INFO]: service alerter:0
processing queue
23.07.2004 20:10:34.2550 quota [INFO]: Restoring unit 02440B
(host_192.168.52.201) violated quota
23.07.2004 20:10:34.2612 quota [INFO]: cAccessScriptCall oid 02440B
action 1 system:512
------
--
С уважением. Алексей.
[-- Attachment #2: action.log --]
[-- Type: application/octet-stream, Size: 213 bytes --]
[-- Attachment #3: action.sh --]
[-- Type: text/plain, Size: 1047 bytes --]
#! /bin/sh
# õÐÒÁ×ÌÅÎÉÅ squid ÄÌÑ netams
ALLOWED_HOSTS="/etc/squid/allowed_hosts"
ALLOWED_TMP="${ALLOWED_HOSTS}.tmp"
LOG="/var/log/netams/action.log"
echo `id`>>"$LOG"
echo "$@">>"$LOG"
echo "x\$1=x$1">>"$LOG"
echo "x\$2=x$2">>"$LOG"
echo "x\$3=x$3">>"$LOG"
echo "x\$4=x$4">>"$LOG"
echo "x\$5=x$5">>"$LOG"
SOB=`echo $5`
echo "\$SOB=$SOB">>"$LOG"
if test "x$SOB"="xQUOTA" ; then
IP=`echo "x$4"|sed 's/[^0-9.]//g' 2>/dev/null`
echo "\$IP=$IP">>"$LOG"
if echo "x$IP" |grep -q '^x\(\([0-9]\.\)\|\(\([0-9]\{2\}\.\)\|\([0-9]\{3\}\.\)\|\([0-9]\{4\}\.\)\)\)\{3\}\([0-9]$\)\|\(\([0-9]\{2\}$\)\|\([0-9]\{3\}$\)\|\([0-9]\{4\}$\)\) 2>/dev/null' ; then
PR=`echo $1`
echo "\$PR=$PR">>"$LOG"
case "x$PR" in
"xALLOW*"
grep -q "$IP" "$ALLOWED_HOSTS" && (echo "$3" >> "$ALLOWED_HOSTS")||: 2>/dev/null
;;
"xDENY*"
grep -v "$IP" "$ALLOWED_HOSTS" > "$ALLOWED_TMP"||: 2>/dev/null
mv -f "$ALLOWED_TMP" "$ALLOWED_HOSTS" ||: 2>&1 >/dev/null
;;
*
;;
esac
service squid reload >/dev/null ||: 2>&1 >/dev/null
fi
fi
:
exit
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-07-23 16:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-23 16:20 [sisyphus] NeTAMS Ошибки передачи параметров скрипту (access-script) Aleksey Avdeev
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git