Код: Выделить всё
# cat /usr/local/etc/netams.cfg.work
#NeTAMS version 3.4.0 (build 2916.1) compiled by root@freeserv.home
#configuration built Sat Feb 16 15:30:25 2008
#begin
#global variables configuration
debug no
language ru
user oid 02A6F4 name admin real-name "Eugene" crypted $1$$1CXSo9ZU3rRh4yE2MnSlV0 email admin@stl.ok.net.ua permit all
user oid 0C8EE2 name moder real-name "Igor" crypted $1$$Xe0JjU7YtEEOODQtwPL9F1 permit all
#services configuration
service server 0
login local
listen 20001
max-conn 6
service processor
lookup-delay 30
flow-lifetime 180
policy oid 0B4940 name ip target proto ip
restrict all drop local pass
unit net oid 022222 name stah_all ip 10.0.0.0 mask 255.255.255.0 description "net 10.0.0.0" password 123 no-local-pass acct-policy ip
unit host oid 033333 name server ip 193.16.45.26
unit host oid 000001 name eugene ip 10.0.0.1 description "ip 192.168.10.5" email eugene@localhost password 123 acct-policy ip
unit host oid 000002 name agent ip 10.0.0.2 description "ip 192.168.10.18" password 123 acct-policy ip
unit host oid 000003 name chetkiller ip 10.0.0.3 description "ip 192.168.10.7" password 123 acct-policy ip
service storage 1
type mysql
host localhost
user netams
password NeTAMS
accept all
service data-source 1
type ip-traffic
source divert 199
layer7-detect urls
service login
storage 1
set name eugene password 123456 inact 0 abs 0
relogin yes
service monitor 0
#monitor to file /usr/tmp/mon_netams.log
monitor to storage 1
monitor unit 000001
monitor unit 000002
monitor unit 000003
service quota
policy ip
notify soft {owner}
notify hard {owner} 02A6F4
notify return {owner}
service alerter 0
report oid 06100 name rep1 type traffic period day detail simple
smtp-server localhost
service html
path /usr/local/www/data/site/stat
run 5min
url http://192.168.10.100/stat/
htaccess yes
client-pages all
account-pages all
service scheduler
oid 08FFFF time 5min action "html"
#end
Код: Выделить всё
unit host oid 000004 name sirius ip 10.0.0.4 description "ip 192.168.10.29" password 123 acct-policy ip
monitor unit 000004
#NeTAMS version 3.4.0 (build 2916.1) compiled by root@freeserv.home
#configuration built Sat Feb 16 15:30:25 2008
#begin
#global variables configuration
debug no
language ru
user oid 02A6F4 name admin real-name "Eugene" crypted $1$$1CXSo9ZU3rRh4yE2MnSlV0 email admin@stl.ok.net.ua permit all
user oid 0C8EE2 name moder real-name "Igor" crypted $1$$Xe0JjU7YtEEOODQtwPL9F1 permit all
#services configuration
service server 0
login local
listen 20001
max-conn 6
service processor
lookup-delay 30
flow-lifetime 180
policy oid 0B4940 name ip target proto ip
restrict all drop local pass
unit net oid 022222 name stah_all ip 10.0.0.0 mask 255.255.255.0 description "net 10.0.0.0" password 123 no-local-pass acct-policy ip
unit host oid 033333 name server ip 193.16.45.26
unit host oid 000001 name eugene ip 10.0.0.1 description "ip 192.168.10.5" email eugene@localhost password 123 acct-policy ip
unit host oid 000002 name agent ip 10.0.0.2 description "ip 192.168.10.18" password 123 acct-policy ip
unit host oid 000003 name chetkiller ip 10.0.0.3 description "ip 192.168.10.7" password 123 acct-policy ip
unit host oid 000004 name sirius ip 10.0.0.4 description "ip 192.168.10.29" password 123 acct-policy ip
service storage 1
type mysql
host localhost
user netams
password NeTAMS
accept all
service data-source 1
type ip-traffic
source divert 199
layer7-detect urls
service login
storage 1
set name eugene password 123456 inact 0 abs 0
relogin yes
service monitor 0
#monitor to file /usr/tmp/mon_netams.log
monitor to storage 1
monitor unit 000001
monitor unit 000002
monitor unit 000003
monitor unit 000004
service quota
policy ip
notify soft {owner}
notify hard {owner} 02A6F4
notify return {owner}
service alerter 0
report oid 06100 name rep1 type traffic period day detail simple
smtp-server localhost
service html
path /usr/local/www/data/site/stat
run 5min
url http://192.168.10.100/stat/
htaccess yes
client-pages all
account-pages all
service scheduler
oid 08FFFF time 5min action "html"
#end
сейчас это делается так:
Код: Выделить всё
cat /usr/local/etc/netams.cfg |
{
while read str
do
echo $str >> /usr/local/etc/netams.cfg.temp
n=`echo ${str}| grep "unit host oid"| awk '{print $4}'` 2>&1 > /dev/null
m=`echo ${str}| grep "monitor unit"| awk '{print $3}'` 2>&1 > /dev/null
if [ "$n" = 0000$last_id ]; then
echo "unit host oid 0000${id} name $name ip $v_ip description \"ip $r_ip\" password 123 acct-policy ip" >> /usr/local/etc/netams.cfg.
fi
if [ "$m" = 0000$last_id ]; then
echo "monitor unit 0000${id}" >> /usr/local/etc/netams.cfg.temp
fi
done
}
может подскажете что-нить?