M
Mark
I have a script setup to log into a host using the Net::Telnet CPAN
module.
It logs on to this host, sends a username and password and then sends
some commands, prints a message to the screen and then closes the
session.
This is working fine for the purpose but I would like to modify it so
that I can get a status of the host before I send commands to change
the configuration of the host.
I would like to do something like the following: (bear with me my
psuedocode aint that great)
get <system route table>
put output -> $variable
grep $variable "0.0.0.0 0.0.0.0 192.168.1.1" -> $newvariable
if $newvariable = "0.0.0.0 0.0.0.0 192.168.1.1" then
print = "Device online"
else
print = "Device not online"
end if
Any ideas?
module.
It logs on to this host, sends a username and password and then sends
some commands, prints a message to the screen and then closes the
session.
This is working fine for the purpose but I would like to modify it so
that I can get a status of the host before I send commands to change
the configuration of the host.
I would like to do something like the following: (bear with me my
psuedocode aint that great)
get <system route table>
put output -> $variable
grep $variable "0.0.0.0 0.0.0.0 192.168.1.1" -> $newvariable
if $newvariable = "0.0.0.0 0.0.0.0 192.168.1.1" then
print = "Device online"
else
print = "Device not online"
end if
Any ideas?