n00b

Hi,

My first attempt at scripting… So here goes something really silly I think…

$NationalGateway is defined as a global var.


[admin@wsmd-core-01] > :put $NationalGateway [interface pppoe-client find name=“National Gateway”
ERROR: invalid argument name
[admin@wsmd-core-01] > interface pppoe-client find name=“National Gateway”
[admin@wsmd-core-01] > interface pppoe-client print
Flags: X - disabled, R - running
0 name=“International Gateway” mtu=1480 mru=1480
interface=ADSL 01 - INTERNATIONAL user=“blah@blah” password=“blah”
profile=ADSL service-name=“” ac-name=“” add-default-route=yes
dial-on-demand=no use-peer-dns=no allow=pap

1 name=“National Gateway” mtu=1480 mru=1480 interface=ADSL 02 - NATIONAL
user=“blah@blah” password=“blah” profile=ADSL service-name=“”
ac-name=“” add-default-route=no dial-on-demand=no use-peer-dns=no
allow=pap

2 name=“Static IP - Server01” mtu=1480 mru=1480
interface=ADSL 01 - INTERNATIONAL user=“blah” password=“blah”
profile=ADSL service-name=“” ac-name=“” add-default-route=no
dial-on-demand=no use-peer-dns=no allow=pap
[admin@wsmd-core-01] >

It must be something silly that I am not doing right…

Thanks for the help :wink:
[/quote]

Assuming you want $NationalGateway variable to refer to a record with the comment “National Gateway”, you should do the following:

:set NationalGateway  [/interface pppoe-client find name="National Gateway"]

Ok, well everything I wanted to achieve is achieved and working, with the exception of one or two really small things… One of them, e-mailing variables…

[admin@wsmd-core] > /tool e-mail send to=mt.wsmd-core@cene
rgynetworks.com subject=“IP Update:wsmd-core:National Gateway:$b”
ERROR: invalid argument name
[admin@wsmd-core] > :environment print
Global Variables
a=165.146.192.1
b=165.146.192.1
c=165.146.192.1
temp=165.146.192.1
Local Variables
[admin@wsmd-core] >

Can someone please explain?? I tried Gateway:" . $b and lots of other “programming defaults”…

Thanks allot guys..

try

/tool e-mail send to=mt.wsmd-core@cenergynetworks.com subject=("IP Update:wsmd-core:National Gateway: " . $b)

Edgars