Hello
I have a Zabbix Server were Linux kernel version 2.6.26-2-amd64 is running.
now my Question how can i make a script that does:
- connect with ssh to a device
- get the systeminfo (but only the interfaces, mac adresses, serialnumber and Software version)
- write the output in a file
Now i made this code but it doesnt work:
Now when i start the script it says this:
If i tip the command by myself it work that means i write:
then it write in the file /infoman/test/juniper/file.txt:
This Shellscript is automated created with a PERL script that look like this:
If you have any question just ask i'm avaible
Thanks!
I'm New at scripting with shell and perl so plz help i need it for my work
Last edited by Fraggy; 04-20-2010 at 09:12 AM..
Reason: Output
Now i tried it and this is the error message:
must i include some modules for send?
Does spawn work with the command ssh?
spawn works with scp but with ssh?..
Greets
Last edited by Fraggy; 04-20-2010 at 09:46 AM..
Reason: Answer
Lose the first line in your script, because you're trying to run an expect script inside an shell.
did you mean #!/bin/bash or #!/usr/bin/except -- ?
anyway i tried both one time without bash and onetime without except and without bash gaves an error that he dont know ssh and without except it doesnt change anything, he also wanted a password (which i gave him manualy) and after closing the session he said:
this is now my code:
hi all,
i have made a shell script and it runs until it reaches the if statement, doesn't the ! mean only if the command fails it will echo me that message and then exit
can anyone please help me what is wrong with my code?
many thanks,
rob
#!/bin/bash
echo "is this archive... (10 Replies)
I have 10 application servers in a distributed architecture generating their own application logs. Each server has application utility to continuously tail the log. for example following command follows tails and follows new logfiles as they are generated
server1$ logutility logtype
When I run... (8 Replies)
Hi Sir/Madam
I have a file data.txt like below
file_name date_of_creation
x 2/10/2012
y 8/11/2010
z 11/3/2013
a 2/10/2013
b 3/10/2013
c ... (4 Replies)
Hi All,
I have prepared a small script to monitor few applications running on diff unix boxes(frontend/backed node1/node2 etc).
ssh does not work for node2 when script executed from crontab..:wall: it work fine when i run it manually.
Regards,
Pavan (4 Replies)
I have simple script. like that, I am working on /usr/local/src and also under src folder there is a ft folder
#!/bin/ksh
#!/bin/bash
dirpath="/usr/local/src/ft"
echo $dirpath
cd $dirpath
echo displays ok "/usr/local/src/ft"
but that doesn't enter "ft" folder. stays in current... (4 Replies)
Hi.
I created schell script for sending messages to some processes in AIX:
#!/bin/sh
BSE=/infor/ERPLN/bse
BSE_TMP=/infor/ERPLN/bse/tmp
export BSE BSE_TMP
for i in `ps -eo pid,comm | grep bshell | cut -f 1 -d " "`
do
/something $i
done
Unfortunatelly this script does not work on... (6 Replies)
i want use ssh on the host01 to execute autoexec.sh on the host02 like following :
host01> ssh host02 autoexec.sh
autoexec.sh include nohup command like follwing :
nohup /home/jack/deletedata.sh &
after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Hi folks
I'm coding on Ubuntu 9.04 standard shell.
I'm writing a script that needs to generate a random number at some point of its execution.
When I do
echo $RANDOMas a command inside shell, I clearly get some randomly generated number
However when I do
i=`$RANDOM`
echo $ior even... (14 Replies)
I need to do a work to my job, but i m new in script shell, someone can help with this.. :confused:
Description
Bsafe The command creates a backup directory of each month at the command line (arguments of the script). The names of directories to copy will always be specified for the... (4 Replies)