Hi All,
I'm using the perl module Spectrum::CLI for some scripts. It is (still) very useful and makes using the vnmsh commands in a perlscript very straightforward.
For instance show devices can be achieved like this:
my $cli = new Spectrum::CLI;
my @DeviceListAoH = $cli->show_devices
What you get back is an array of hashes. Each line is stored as a hash in the array. The hash holds each column, so all output is available.
All happy so far and starting this from bash shell works fine. The only requirement is that the SPECROOT must be set in bash.
Now I want to start my script using cron which does not have this SPECROOT set and ever since the script does not work
The readme for Spectrum:CLI states the following:
<new> - create a new Spectrum::CLI object
$obj = Spectrum::CLI->new([VNM_Name,]
[SPECROOT,]
[ {
[verbose => 1,]
[Verbose => 1,]
[CLISESSID => $sessid,]
[CLIMNAMEWIDTH => $width,]
[VNMSHRCPATH => $path,]
[localhostname => $localname,]
[timeout => $seconds,]
} ]);
my $cli = new Spectrum::CLI;
Checked the several examples which came with the module but none of them show an example where the SPECROOT needs to be set
In one of the examples I see this:
my $cli = new Spectrum::CLI { CLIMNAMEWIDTH => 16, verbose => 1 }, $ARGV[0];
I can't reproduce this with setting the specroot... (In the meantime I've been told how to set the environment for cron using the source command but I want to set it using the actual script which calls the method)
Anybody any clue as to how this should work?
many thanks
Hans