LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-01-2015, 03:46 AM   #1
piyush128k
Member
 
Registered: Jun 2012
Posts: 68
Blog Entries: 1

Rep: Reputation: Disabled
Python Script to detect OS and update name server and options in resolve.conf on mult


I am trying to code a python script that does:- Using root account logs into multiple servers provided in a list. Check the OS type e.g. Linux, Solaris, HP-UX and Windows. Depending on the OS type it updates the name servers and options in /etc/resolv.conf. The update is done from a list that is also provided.

Any help is much appreciated.
 
Old 06-01-2015, 04:31 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,527

Rep: Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439
and how do you imagine this help? What do you expect now?
 
1 members found this post helpful.
Old 06-01-2015, 09:36 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826
Sounds like a good challenge ... what have you done and where are you stuck?
 
Old 06-06-2015, 04:43 PM   #4
piyush128k
Member
 
Registered: Jun 2012
Posts: 68
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Thanks for your questions...no help from that. The answer to a question is not a question but guidance in the form of an answer.

I got things moving on and i should be fine. I have been reading books and researching on the web a lot though i am no where near to finishing it but am moving ahead gradually.
 
Old 06-07-2015, 05:50 AM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826
Quote:
The answer to a question is not a question but guidance in the form of an answer.
I beg to differ. our questions are guidance in the form of show us what you have tried as opposed to tell me the answer which is what you presented initially.

Without any examples or effort on your behalf you will find little that we can do for you as no one here will tell you the answer.
 
1 members found this post helpful.
Old 06-07-2015, 06:03 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
Quote:
Originally Posted by piyush128k View Post
I am trying to code a python script that does:- Using root account logs into multiple servers provided in a list. Check the OS type e.g. Linux, Solaris, HP-UX and Windows. Depending on the OS type it updates the name servers and options in /etc/resolv.conf. The update is done from a list that is also provided.

Any help is much appreciated.
Won't always work... It depends on the individual system.

If they are using DHCP, any changes made will be wiped out on next boot...

In the case of Linux, it depends on the distribution - RH/Fedora/CentOS/SL uses /etc/ifcfg-<ifname> files to initialize /etc/resolv.conf, and things may change depending on DHCP, number of interfaces... and it will again wipe out any changes you make.
 
Old 06-07-2015, 03:36 PM   #7
piyush128k
Member
 
Registered: Jun 2012
Posts: 68
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
jpollard the situation you present is not what i have so that part which you correctly shared is not my case.

The team in the past has been very helpful.

I am good on my own as i have done alot myself and can proceed.

How can i close this thread.
 
Old 06-07-2015, 08:59 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,349

Rep: Reputation: 3910Reputation: 3910Reputation: 3910Reputation: 3910Reputation: 3910Reputation: 3910Reputation: 3910Reputation: 3910Reputation: 3910Reputation: 3910Reputation: 3910
Quote:
Originally Posted by piyush128k View Post
jpollard the situation you present is not what i have so that part which you correctly shared is not my case.

The team in the past has been very helpful.

I am good on my own as i have done alot myself and can proceed.

How can i close this thread.
You can post the solution you say you came up with, and mark the thread solved.
 
  


Reply

Tags
python based


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
resolve.conf - different domain resolution per server mvrk Linux - Networking 1 11-13-2013 08:19 AM
[SOLVED] Need a script which reinstates original content of /etc/resolve.conf after using Wicd Dennola4 Slackware 2 12-16-2010 03:49 AM
Unable to resolve ulr. /et/resolve.conf looks fine? TheBrick Linux - Networking 3 02-14-2008 05:13 AM
/etc/hosts, /etc/resolve.conf and /etc/host.conf config probs below_average Linux - Networking 1 12-08-2004 11:07 PM
Perl Script - Detect if Server up zael Programming 1 02-09-2004 11:13 PM


All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration