Programming :: Perl Module For Getting Information From Remote Machines
Oct 16, 2010
I need to get some information like cpu usage,free memory,swap memory and other information from a bunch of remote hosts.Can any one tell me of a good perl module which does that.I dont want to use Net::Rsh or Net:SSH.
I need to extract the Info from the RC column for the first 4 players of liverpool. The test code i have does the same,but can anyone show me a better way of doing it.I could do it easily with gawk -F"|" and print the respective column,but i need to do this in perl.
my $file = 'test/mybigfile'; my $zip = Archive::Zip->new(); my $zipped = $zip->addFile($file);
[code]....
it simply takes a file (in this case, "mybigfile") and creates a ZIP file containing that file only. Now, my problem is that when I go to decompress the ZIP file, it creates the relative (or absolute, depending on case) path of the original file. To make an example:
Code:
$ pwd /tmp/perl $ ls -R
[code]....
What I need is *not* to store the path information inside of the ZIP file, so that once I decompress the ZIP file I only get the original one without having paths created.
I'm writing a Plug-gable authentication module for ssh. I am looking for prompting for some extra information after user name and password verification but before giving access to user.Actually after SSH I want to extend the same for some other services. So I am looking at some PAM module level suggestion.
I tried using conversation method with message style=PAM_PROMPT_ECO_ON but it results in PAM_CONV_ERR and conversation fails. Is it right way to interact or please suggest me If I'm doing wrong somewhere. When I use message style=PAM_PROMPT_ECO_OFF communication succeeds but message is not shown and interaction doesn't happen.
I'm trying to write a script in Perl to download a file that requires NTLM authentication to access, stored on a machine on this network.The file exists, and can be accessed through a web-browser, btw.
I need to install the Perl DBI and DBI::mysql modules at Amazon Web Services. Perl 5.8.8 is installed there as part of the default Fedora linux that comes with an EC2 instance. I am not familiar with Fedora, but have been using Linux for a good while.If anyone could tell/show/direct me to the quickest way to do this.
I want to connect to MySQL Database installed on RHEL 5 using perl v 5.8.8.The available DBD perl drivers installed on my machine are:DBM, ExampleP, File, Pg, Proxy, Sponge..I downloaded DBD-mysql-2.1012 and tried installing DBD again but got the following error:Can't exec "mysql_config": No such file or directory at Makefile.PL line 167.readline() on closed filehandle PIPE at Makefile.PL line 169.On searching I found that I need to install libz-devel prior to installing driver for MySQL for Perl.
I am trying to make use of the perl module WWW::Nike::NikePlus to retrieve the data from my ipod but apparently I have no idea what I am doing. I installed the package just as the readme said including all the dependencies. I cant really figure out how to run it, i searched for how to use it and found this : Example use that retrieves and prints your last run information
use WWW::Nike::NikePlus; my $username = 'my@email.address'; my $password = 'MySecretPassword'; my $locale = "en_us"; my $pin = nike_authenticate( $username, $password, $locale ); unless( $pin ) { print "Authentication failed "; } .....
#Details of the last run my ($unit, $last_run_dist, $last_run_duration_millisecs, $last_run_duration_friendly, $last_run_pace_friendly) = nike_last_run(); print "Last run: $last_run_dist$unit in $last_run_duration_friendly "; print "Last run pace: $last_run_pace_friendly per $unit ";
So I put it in a txt file and saved it with the extension .pl and of course I put in all my info in the username password fields then made it executable with the command sudo chmod +x nikeplus.pl and when I try to run it with either ./ or perl I get this output:
brandon@desktop:~/Apps/nikeplus$ ./nikeplus.pl ./nikeplus.pl: line 1: use: command not found ./nikeplus.pl: line 2: my: command not found ./nikeplus.pl: line 3: my: command not found ./nikeplus.pl: line 4: my: command not found ./nikeplus.pl: line 6: syntax error near unexpected token `(' ./nikeplus.pl: line 6: ` my $pin = nike_authenticate( $username, $password, $locale );' brandon@desktop:~/Apps/nikeplus$ perl nikeplus.pl Use of uninitialized value $ENV{"TEMP"} in concatenation (.) or string at /usr/local/share/perl/5.10.0/WWW/Nike/NikePlus.pm line 10. Use of uninitialized value $last_run_duration_millisecs in division (/) at /usr/local/share/perl/5.10.0/WWW/Nike/NikePlus.pm line 106. Use of uninitialized value $last_run_dist in division (/) at /usr/local/share/perl/5.10.0/WWW/Nike/NikePlus.pm line 107. Use of uninitialized value $last_run_duration_millisecs in division (/) at /usr/local/share/perl/5.10.0/WWW/Nike/NikePlus.pm line 107. Illegal division by zero at /usr/local/share/perl/5.10.0/WWW/Nike/NikePlus.pm line 107. brandon@desktop:~/Apps/nikeplus$
I have Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 mod_fcgid/2.3.4 Phusion_Passenger/2.2.14 PHP/5.2.10-2ubuntu6 with Suhosin-Patch configured In UBUNTU 10.04 I like to install apache2 mod_perl I make apt-get install libapache2-mod-perl2 and I get: Quote: libapache2-mod-perl2 is already the newest version.
Ok I try sudo a2enmod mod_perl ERROR: Module perl does not exist! how I make Perl work in apache2 UBuntu 10.04
I'm attempting to set up a GIMP scripts for batch operations on groups of image files. Initially I started reading about the Script-Fu syntax but it looked too convoluted (at least for me, with 15 years of Perl experience at work) in a way it does the simpliest of things so I attempted to use Perl instead of Script-Fu. From reading the docs I see that I need to install "Gimp::Fu" Perl module. I installed "cpan" first, started it and issued the command:
install "Gimp::Fu"
and got a dependency problem:
Code:
cpan[1]> install "Gimp::Fu" CPAN: Storable loaded ok (v2.18) Going to read /root/.cpan/Metadata Database was generated on Thu, 28 Oct 2010 17:30:45 GMT
I have an apache2 php5 on an ubuntu 10.04 it was working fine except today and does not open web site now. I tried to open phpinfo.php but it takes long time and at the end it loads php informations just until date module. I installed php5-cli to find out what does not work properly then I used:
Quote:
# php5 -i PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/gd.so' - /usr/lib/php5/20090626+lfs/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib
I need to install different version of Perl with needed modules to Test Run a perl script (ASSP) without affecting the existing one as the old version of Perl is buggy with seg fault.
I have installed perl5.12.3 in a custom location, ( a NFS share). I have all the libraries created in the same location. This was an attempt not to disturb existing version of perl. I have succeeded doing this.Now, I need to install around 200 perl modules. I tried Bundle option in CPAN shell, it somehow did not work. Does anyone here know off any other better method of installing multiple perl modules. How do I use CPANPLUS to install all the modules. What changes do I make to Config.pm considering custom location of perl installation I have done.
utility to let me automatically apply shell commands I type to a list of given remote machines? I'm configuring and maintaining multiple servers all running Fedora 12 and I want them to have exactly the same configuration. I also need to check out code from subversion onto these machines; the same code from the same location into the same directory. I know I could use ssh to run each command individually for each machine, but is there a tool that will make this much easier?
I would like to setup grsync to auto backup me xp desktop and win7 laptop.I have setup samba and can access the directories on the ubuntu server.I can see the desktop and laptop on the network from the server.But when I try to find the machines i want to backup in source in grsync they are not there.What should the permissions be on the windows machines?
recommend a utility to let me automatically apply shell commands I type to a list of given remote machines?I'm configuring and maintaining multiple servers all running Fedora 12 and I want them to have exactly the same configuration. I also need to check out code from subversion onto these machines; the same code from the same location into the same directory. I know I could use ssh to run each command individually for each machine, but is there a tool that will make this much easier?
I am trying to write a shell script which will give remote system version and list of installed applications and their versions as output. In this case remote system is windows xp and I have ip address, username and password of that machine.
how possible it is if at all to get information out from remote printers?Mainly i'd like to know the printer trays the printer has available and how the printer has assigned names to those trays, in order for me to send print jobs to specific print trays and know that i'm using the correct tray name whereas currently its a guess and thus probably not workingI have lpr and have printcap file set-up and have no problems in printing, I just want to be able to specify more options and in order to do this i feel i need to probe the printer somehow to find out what options are available?
The geek-in-me won and I bought a spiffy little Acer Aspire One netbook, windows 7 starter installed. Now I take it to clients' workplaces instead of my 19" laptop (that I also bought because the geek-in-me won that time too).
So what do I install in the Suse/openSUSE range? I want a lightweight Linux, like Meego or openSUSE with a light Desktop. I need to be able to use remote connections like RDP and VNC to both Linux and windows machines, so maybe Meego can't do that? But maybe openSUSE with a very light Desktop will. I'll use gmail from the netbook, no need for Thunderbird etc. I like to have multimedia.
if this a simple question I apologise, I'm using a SSH connection to a remote machine which also has ubuntu installed, my remote machine is connected to a windows server, using <places> <Network> and clicking on the server, doing this mounts the server into my remote file systemWhen i look around the file system of the remote machine i'm unable to make the windows server resource available to me.I Assume it has a service file in the /dev directory, but would not know what its called or what i would have to do with it.In the mean time i've managed to connect directily to the server from my local machine, (which is probbialy a better solution) but is it possible to see the server via my remate machine?
I am interested in using fortran and an external library called matio used to save arrays to matlab .mat files. I have installed the matio and matio-dev packages from synaptics but i cannot compile a code receiving an error Code: christos@christos-laptop:~/Desktop$ gfortran -o test test.f90 -lmatio -lz test.f90:2.13: USE MATIO 1
Fatal Error: Can't open module file 'matio.mod' for reading at (1): No such file or directory How can i load a module in order to use it in fortran through the GCC compiler?
is it possible using a perl script to test for a socket listening on a UDP port on a remote host ?I work in an environment where netcat is not allowed and from time to time I need to see if a UDP port is open on a remote host.