Server Management - Systems Insight Manager
cancel
Showing results for 
Search instead for 
Did you mean: 

mxquery and list creation

Matt Duncan_1
Occasional Contributor

mxquery and list creation

I've just completed my migration from CIM 7 SP2.3 to SIM 4.2 using the migration tool HP provides. Unfortunately the tool did not migrate my queries, which were based on server name, properly. Now I need to recreate those and using the GUI would be a painful process. Could someone please provide me with an example syntax for the file I would feed mxquery?
What I'm specifically looking for is the ability to create a device list based on multiple server names (up to 400 per list). I'd also like to create an event list based on multiple server names (again up to 400) and a severity of Critical, Major, or Minor. Any help in the syntax for the xml would be greatly appreciated.
4 REPLIES
David Claypool
Honored Contributor

Re: mxquery and list creation

Check out http://www.hp.com/go/hpsim --> Information Library and see the Man pages section at the bottom. You'll want to look at mxquery.4.html. Towards the end of the page are some examples of XML files.

You also could build one in the GUI as an example -- maybe not with all 400 names -- and then examine the resulting XML and modify it and replace the one in the system. To spit out the XML of a query

mxquery -l t "queryname"
Alfredo Soares
Frequent Advisor

Re: mxquery and list creation

Hi Matt,

Where you able to create a query that add systems on a file, to System Lists on SIM??
If yes, can tou provide me with that?

As you can see on ( http://forums2.itrc.hp.com/service/forums/questionanswer.do?threadId=938258 ), David helped me out, but i cannot put to work the query.

Thank you very much

Alfredo
David Claypool
Honored Contributor

Re: mxquery and list creation

Bumped to be above moved questions...
Tom McGuigan
Frequent Advisor

Re: mxquery and list creation

All,
FYI, on a related topic, I recently attempted to insert a new query by 1) extracting all querries, and 2) modifying a query slightly (rename it and modify the list of selected servers/criteria). I have done this several times successfully, so I was suprised when I encountered problems this time. It seems the "index" value you use should NOT duplicate any previous entry. I had not messed with this value before but evidently it should be unique/new for new queries. The problem became apparent when I tried to perform subsequent extracts (mxquery -l t Querydef.txt). The result was "An internal error occurred. Index 0". I was still able to perform extracts of all query names, but the xml output containing the query details were no longer available. I'm not going to try to troubleshoot this further...we are in the process of restoring the database from backup right now. I'll probably take the precaution of getting a snapshot of the database before performing another insert, just in case the problem recurs.