ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I wrote a perl script to feed information to our load balancer:
Code:
#!/usr/bin/perl
#
use strict;
#use warnings;
#
#
use Net::SSH::Perl;
my $user="bluethundr";
my $pass="secret";
my $dir="$ENV{HOME}/data";
open (LBVSERVERS), '<', "$dir/lb-vserver" or die "Couldn't open file: $!";
open (CSVSERVERS), '<', "$dir/cs-vserver" or die "Couldn't open file: $!";
my $ssh = Net::SSH::Perl->new("10.50.0.1");
$ssh->login("$user", "$pass");
print "\n\n\n\n\n**********LB VSERVERS**********\n\n\n\n\n";
while (my $line = <LBVSERVERS>) {
chomp $line;
my ($number, $lbvserver) = split(/\s+/, $line);
print "show lb vserver $lbvserver\n";
$ssh->cmd("show lb vserver $lbvserver");
chomp(my $ans = <STDIN>);
print "Ready for next lb vserver? (y/n): ";
if ($ans=~/y|Y/) {
next;
} else {
chomp(my $done = <STDIN>);
print "Quit? (y/n): ";
if($ans=~/y|Y/) {
last;
} else {
next;
}
}
print "\n\n\n\n\n**********CS VSERVERS**********\n\n\n\n\n";
while (my $line = <CSVSERVERS>) {
chomp $line;
my ($f1, $f2, $f3, $csvserver) = split(/\s+/, $line);
print "show cs vserver $csvserver";
$ssh->cmd("show cs vserver $csvserver");
print "Ready for next cs vserver? (y/n): ";
if ($ans=~/y|Y/) {
next;
} else {
chomp(my $done = <STDIN>);
print "Quit? (y/n): ";
if($ans=~/y|Y/) {
last;
} else {
next;
}
}
}
}
close LBVSERVERS;
close CSVSERVERS;
I need to be able to install the Math::Pari CPAN module in order to accomodate the Net::SSH CPAN module.
The prereqs are installed:
Code:
cpan> install Net::FTP
Net::FTP is up to date.
cpan> install LWP::UserAgent
LWP::UserAgent is up to date.
But when I either try to install or force install Math::Pari this is what I get:
Code:
cpan> install Math::Pari
Running install for module Math::Pari
Running make for I/IL/ILYAZ/modules/Math-Pari-2.01080604.tar.gz
Checksum for /home/bluethundr/.cpan/sources/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.01080604.tar.gz ok
Math-Pari-2.01080604/
Math-Pari-2.01080604/Changes
Math-Pari-2.01080604/func_codes.h
Math-Pari-2.01080604/INSTALL
Math-Pari-2.01080604/libPARI/
Math-Pari-2.01080604/libPARI/codes_2014
Math-Pari-2.01080604/libPARI/expected_codes
Math-Pari-2.01080604/libPARI/extract_codes.pl
Math-Pari-2.01080604/libPARI/gphelp
Math-Pari-2.01080604/libPARI/Makefile.PL
Math-Pari-2.01080604/Makefile.PL
Math-Pari-2.01080604/MANIFEST
Math-Pari-2.01080604/META.yml
Math-Pari-2.01080604/Pari.pm
Math-Pari-2.01080604/Pari.xs
Math-Pari-2.01080604/PariInit.pm
Math-Pari-2.01080604/patches/
Math-Pari-2.01080604/patches/diff_2.1.2_gccism
Math-Pari-2.01080604/patches/diff_2.1.3_interface
Math-Pari-2.01080604/patches/diff_2.1.4_interface
Math-Pari-2.01080604/patches/diff_2.1.6_align_power_of_2
Math-Pari-2.01080604/patches/diff_2.1.6_no-common
Math-Pari-2.01080604/patches/diff_2.1.6_ploth64
Math-Pari-2.01080604/patches/diff_2.1.7_-O
Math-Pari-2.01080604/patches/diff_2.1.7_div
Math-Pari-2.01080604/patches/diff_2.1.7_mingw-w64
Math-Pari-2.01080604/patches/diff_2.1.7_restart
Math-Pari-2.01080604/patches/diff_2.2.2_interface
Math-Pari-2.01080604/patches/diff_pari-2.1.3-ix86-divl
Math-Pari-2.01080604/patches/patch-pari-unnormalized-float
Math-Pari-2.01080604/README
Math-Pari-2.01080604/t/
Math-Pari-2.01080604/t/000_load-problem.t
Math-Pari-2.01080604/t/00_Pari.t
Math-Pari-2.01080604/t/PlotRect.t
Math-Pari-2.01080604/t/zz_leak.t
Math-Pari-2.01080604/test_eng/
Math-Pari-2.01080604/test_eng/ex.t
Math-Pari-2.01080604/test_eng/Testout.pm
Math-Pari-2.01080604/TODO
Math-Pari-2.01080604/typemap
Math-Pari-2.01080604/utils/
Math-Pari-2.01080604/utils/chap3_to_pod
Math-Pari-2.01080604/utils/comp_funcs.pl
Math-Pari-2.01080604/utils/foncpari.pl
Math-Pari-2.01080604/utils/inc.h
Math-Pari-2.01080604/utils/inc_h.diff
Math-Pari-2.01080604/utils/Math/
Math-Pari-2.01080604/utils/Math/PariBuild.pm
Math-Pari-2.01080604/utils/notes
Math-Pari-2.01080604/utils/paridoc_to_pod
Math-Pari-2.01080604/utils/README
CPAN.pm: Going to build I/IL/ILYAZ/modules/Math-Pari-2.01080604.tar.gz
Did not find GP/PARI build directory around.
Do you want to me to fetch GP/PARI automatically?
(If you do not, you will need to fetch it manually, and/or direct me to
the directory with GP/PARI source via the command-line option paridir=/dir)
Make sure you have a large scrollback buffer to see the messages, or `tee'
the STDOUT/STDERR to a file.
Fetch? (y/n, press Enter) y
Getting GP/PARI from ftp://megrez.math.u-bordeaux.fr/pub/pari/unix/
Cannot list (Failed to establish connection.
): at utils/Math/PariBuild.pm line 319, <STDIN> line 1.
Can't fetch file with Net::FTP, now trying with LWP::UserAgent...
You do not have LWP::UserAgent and/or HTML::LinkExtor installed, cannot download, exiting...
I would certainly appreciate some help past this sticking point.
It sounds like the code is unable to connect via FTP to megrez.math.u-bordeaux.fr site.
When I open the FTP URL (e.g. in FTP client or browser), I can see the contents.
Could you try the same?
Perhaps even fetch the source manually and use the paridir=... option as suggested?
This could help in starting to sort out the connection issue.
it's a pretty old thread here, but I'm hitting the same problem.
In my case, the domain 'megrez.math.u-bordeaux.fr' seems to be not reachable. I tried it with deifferent tools (FTP and HTTP) and on different networks (DSL and mobile) with same result. Does anyone have an idea, if there is an alternative to get Math::Pari installed without the files from the failing domain (I'm a very beginner with perl an CPAN).
Indeed, this is an old thread. It is generally preferable to start your own thread for two important reasons:
1. Even though your case may seem very similar, your own thread assures that the discussion is constrained to the particulars of your own case which makes it easier for those offering help and all future visitors to follow without being sidetracked by differences - in either thread.
2. Your new thread will be automatically bumped to guarantee it is visible to current members, whereas the old thread, and your question, will disappear into the mists of time!
But no harm done, and thanks for reporting your ultimate success!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.