Dranzaz has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
Recently I have had to update a router interface speed check script to work with the newer Cisco CRS routers that run XR instead of IOS. The only way I could get the script to connect to the routers at all was to utilize the Nett::OpenSHH module. Unfortunately it was not available via "yum update". Instead I downloaded the compressed file and manually installed (MAKE) the Module.
I can manually run the script without issuse or error. However, when the cronjob attempted to run it spits out and error (see below). I searched this site and others and the only recommendation I have found so far was to ensure "perl -mcpan" (?) showed is as properly installed. If have done this and it claimed that the module it "up to date".
Can anyone assist in getting this module to be recognized when cron is attempting to run the script.
Relevant Inforamtion:=================================================#!/usr/local/perl -w #set modules to use use Net::Ping; use Net::SSH::Perl; use Net::OpenSSH; use Net::SMTP; use DBI; $ENV{'MYSQL_UNIX_PORT'} = '/tmp/mysql.sock'; $ssh = Net::OpenSSH->new("$hostnames[$testcount]", user => $username, +password => $password, master_stderr_discard => 1) || warn("\$!\n"); $out = $ssh -> capture ("show interfaces $interface[$routercom] | incl +ude BW"); print LOGONE $out; close (LOGONE);
UPDATE: The issue has been resolved by copying the OpenSSH.pm file and its associated folder from the suers perl directory into the system perl installation. Thanks to everyone for their assistance. As always the monks here rule.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CRON job failing but manual run works
by kcott (Archbishop) on Aug 15, 2012 at 18:05 UTC | |
by Dranzaz (Sexton) on Aug 15, 2012 at 19:42 UTC | |
by bart (Canon) on Aug 15, 2012 at 20:40 UTC | |
by kcott (Archbishop) on Aug 15, 2012 at 20:41 UTC | |
by Dranzaz (Sexton) on Aug 15, 2012 at 19:58 UTC | |
|
Re: CRON job failing but manual run works
by aitap (Curate) on Aug 15, 2012 at 19:05 UTC | |
|
Re: CRON job failing but manual run works
by pvaldes (Chaplain) on Aug 15, 2012 at 20:14 UTC | |
by Dranzaz (Sexton) on Aug 16, 2012 at 13:32 UTC | |
by Dranzaz (Sexton) on Aug 16, 2012 at 16:03 UTC | |
|
Re: CRON job failing but manual run works
by pvaldes (Chaplain) on Aug 16, 2012 at 13:57 UTC |