Are you a spammer

Please note, that the first 3 posts you make, will need to be approved by a forum Administrator or Moderator before they are publicly viewable.
Each application to join this forum is checked at the Stop Forum Spam website. If the email or IP address appears there when checked, you will not be allowed to join this forum.
If you get past this check and post spam on this forum, your posts will be immediately deleted and your account inactivated.You will then be banned and your IP will be submitted to your ISP, notifying them of your spamming. So your spam links will only be seen for an hour or two at most. In other words, don't waste your time and ours.

This forum is for the use and enjoyment of the members and visitors looking to learn about and share information regarding the topics listed. It is not a free-for-all advertising venue. Your time would be better spent pursuing legitimate avenues of promoting your websites.

Need a script that runs commands remotely...

Source code I have written openly published for your viewing pleasure.


Need a script that runs commands remotely...

Postby Epic » Fri Aug 29, 2008 11:20 am

Hey everyone, I have no experience with any scripting language :oops: that's why I'm coming for help :D . Here is the scenario: There are about 40 Linux machines (I'm gonna call these "clients") in a lab. There is one machine (I'm gonna call this "server") dedicated to store information about all those 40 machines that are constantly running. I need a script that will log into each of those "client" machines run some commands such as smartctl and iostat, to collect disk information from them and save that information in a text file resident in that one "server" machine. I imagine there would be one file per "client" and the file name would have the machine name, command run, and time stamp.

Any help will be appreciated. Thanks.
Epic
U.E. Newbie
U.E. Newbie
 
Posts: 17
Joined: Thu Oct 25, 2007 11:26 pm
Age: 36
Operating System: Ultimate Edition 3.2 32 BIT



Re: Need a script that runs commands remotely...

Postby TheeMahn » Fri Aug 29, 2008 3:49 pm

Epic wrote:Hey everyone, I have no experience with any scripting language :oops: that's why I'm coming for help :D . Here is the scenario: There are about 40 Linux machines (I'm gonna call these "clients") in a lab. There is one machine (I'm gonna call this "server") dedicated to store information about all those 40 machines that are constantly running. I need a script that will log into each of those "client" machines run some commands such as smartctl and iostat, to collect disk information from them and save that information in a text file resident in that one "server" machine. I imagine there would be one file per "client" and the file name would have the machine name, command run, and time stamp.

Any help will be appreciated. Thanks.


pretty heavy, I would start by generating IP's of each comp pipe it to a text file, this will be the list in which the script will hit, I am assuming the "server" has execution rights on the "clients" end.

now it starts to become easy parse each ip samba / nfs? well I guess not so easy a failure routine if using samba for example would have to be written piping all output to the main server. I would make the script output the file to a txt file as per ip.

You have asked more then I have the time to write, yes it can be done, I do not get paid enough to write it ;)

TheeMahn
Home of Ultimate Edition. Got a question? Please review the F.A.Q. Browse the How to section.

Main O/S: Builder of O/S Guess.
Mainboard: ASUS Hero VI (AM4)
CPU: AMD 1700X water cooled (Deepcool Captain Genome Cooling tower)
Ram: 16 GB GSkill Trident RGB Series Dual Channel DDR4 3200
Video: MSI RX470 8GB Gaming card.
Hard Disks: MASSIVE on the network.(10 Gigabit, 48 port, multiple servers)
Monitors: Dual 4K 43" LG, 4K Samsung 28"
750 Watt modular PSU (Rosswell)
1100 Watt Amp & 4 X 600 Watt speakers

Servers in the basement.
User avatar
TheeMahn
Site Admin
 
Posts: 4201
Joined: Fri Oct 12, 2007 10:02 am
Location: U.S.A.
Age: 53
Operating System: Ultimate Edition Developer



Re: Need a script that runs commands remotely...

Postby Epic » Fri Aug 29, 2008 4:04 pm

Thank you for the reply. I guess, all I would need is some tips on how to do this (not the script written for me) or maybe someone has something similar that I could tweak it to work for me. I made this post because I have never had any experience with any kind of scripting language, but I know that that easiest way would be to do it in something like a regular bash script or Perl. That idea about a file with all the IPs or something like a regular host file in Linux, is a good idea that I was actually thinking of. I guess my problem is making it happen, so all I ask is some tips and a pointer in the right direction on how to do this. Thanks again for the response.
Epic
U.E. Newbie
U.E. Newbie
 
Posts: 17
Joined: Thu Oct 25, 2007 11:26 pm
Age: 36
Operating System: Ultimate Edition 3.2 32 BIT


Return to Programming

Who is online

Users browsing this forum: No registered users and 10 guests