I have made a bash script to get ipstats of several devices, and i have a problem with my X450a-48t, the script works fine if i execute it manually, but in crontab no output, i think because in cron no tty is allocated.
ssh -o "StrictHostKeyChecking no" firstname.lastname@example.org "show ipstats"
i have checked ssh with -t and -tt option, but doesn't work.
¿Any idea how to solve it? ¿another possibility to get this stats remotely?
The script executes perfectly if I run it manually from command line. However, running the same script within cron and it fails. I have a user account using a ssh user-key added to the admin account on the switch.
Here's the command executing by the script:
"ssh -oStrictHostKeyChecking=no admin\@$xxrip upload configuration $tftpserver $xxrname.xsf" where $xxrip, $tftpserver and $xxrname are passed into the command from a hash.
I've tried adding the -t -t option but no change.
My error code from the perl script for this command is 255, both from running the script manually, or through cron - I'm guessing 255 is "all ok" as the script works just fine running manually. However, the configuration file is never uploaded to my tftp server when running the script through cron.
I contacted tech support and opened a case (#01203422), but they've passed me off with the following:
I wanted to follow up with you on this case. Unfortunately at this point there's nothing more we can do to troubleshoot this as this is an issue with KRON and not the switch itself. Have you tried to contact support for the scheduler?"
I'm looking for any help with this. I can share my perl script and git methods with anyone that is interested. Having a copy of the latest configuration(s) has saved me a few times.
which version of EXOS do you use? In my testing older firmware versions did not work, while newer did.
Did you try to run your script with /dev/null as STDIN from a terminal window? That resulted in the same problem as running the command from cron for me.
$ my_script </dev/nullHTH,