Server Management - Systems Insight Manager
1752789 Members
6143 Online
108789 Solutions
New Discussion юеВ

Automated Hosts File export

 
SOLVED
Go to solution
Gene Nordahl
Valued Contributor

Automated Hosts File export

Anybody have a script to export the hosts file out of SIM? Any ideas on if it can be done or am I stuck with the manual process via Options>Discovery>Hosts Files?

Thanks in advanced
Gene
8 REPLIES 8
David Claypool
Honored Contributor

Re: Automated Hosts File export

What are you trying to do? Is it really the hosts file you need or just a formatted file with IP address and hostname?
Gene Nordahl
Valued Contributor

Re: Automated Hosts File export

What I'm looking to do is export the system list out of our live SIM server in a format that I can use to import into a standby SIM server in the event of a disaster.

Is just a formatted file with IP and Hostname all that is needed to populate the standyby server? If so, what format does it need to be in? I can then set up a job to pull that directly out of the DB.

Thanks
David Libby_4
Regular Advisor
Solution

Re: Automated Hosts File export

If you're running SIM on HP-UX check out the man page of the mxnode command... you can export and import node-lists to and from both XML files and the DB, works well.

As far as I know these commands exist on windows too...

If you run:

mxnode -lf > all-my-nodes.xml

It will export all your nodes into that file, which you can import on the other side...

mxnode -a -f all-my-nodes.xml [-w]

...identification will also be run simultaneously and the [-w] will force the command to wait for the DB to be uptodate after every addition (go for a coffee if you set this flag).

Have fun.
Gene Nordahl
Valued Contributor

Re: Automated Hosts File export

Exactly what I needed and yes they run on Windows too.

Thanks for the help David.

Gene
David Libby_4
Regular Advisor

Re: Automated Hosts File export

You're welcome... :-)
jaywardhan
Frequent Advisor

Re: Automated Hosts File export

I tried the same and after i run "mxnode -a -f all-my-nodes.xml [-w]" on the backup node i dont see any systems added.

Am i missing something. I want to backup the servers data from the Production server to a backup SIM server.

Please help!!!
Gene Nordahl
Valued Contributor

Re: Automated Hosts File export

Are you getting an error when running the add? What OS are you running?? I ask because it stopped working for me when I went to x64 (see thread http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1133700

Also confirm the login you are using on your backup system to add the nodes is a full administrator in SIM.

Derek_56
Valued Contributor

Re: Automated Hosts File export

Gene,

I've had that same issue, but mine was caused by the "GUID" entry for each node. I was going to parse it out using a script but ran short on time. I ended up doing a "mxnode -ln" only without the details. I am still cleaning up SIM and getting the details added back in. If you have a small amount of servers managed, you could manually remove the problem details. Otherwise I'd stick with the -ln option.