Thank you Michal, I didn't see that syntax documented in the api docs
but it does work.

Now on the bulk hosts creation perl script I am running into issues with
parents not existing yet 

-          so I am faced with either trying to do some sort of ordering
to make sure hosts listed as parents are created first

-           or just capturing failed hosts and reprocessing them after
the 1st batch is complete

 

Either way it appears I'm past the Syntax errors so I appreciate your
help there..

 

James Whittington

VC3, Inc.

 

 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Michal
Zyzak
Sent: Monday, September 07, 2009 1:22 AM
To: 'Opsview Users'
Subject: Re: [opsview-users] Any success using api to do a bulk import
ofhosts

 

Hi!

 

I know this one!

 

You need to use this syntax to input parents:

 

<parents>

   <parent>

    <name>Parent_Host</name>

   </parent>

</parents>

 

 

------------------------------------

 

Regards

 

Michal Zyzak

Administrator   

+48 71 3761 689

+48 665 351 639

 

TIM S.A.

ul. E. Kwiatkowskiego 24

55-011 Siechnice

Poland

 

------------------------------------------------------------------------
------------

This email and any attachments are intended only for the named recipient
and may 

contain confidential and/or privileged material.

Any unauthorized copying, dissemination or other use by a person other
than 

the named recipient of this communication is prohibited.

If you received this in error or are not named as a recipient, please
notify the sender 

and destroy all copies of this email immediately.

------------------------------------------------------------------------
------------

 

 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of James
Whittington
Sent: Friday, September 04, 2009 11:06 PM
To: Opsview Users
Subject: [opsview-users] Any success using api to do a bulk import of
hosts

 

I am trying to do a bulk import of hosts using the Opsview Api.

I have a csv source file with

Host,ip,alias,parent

 

I am reading in the csv, printing the xml to a file then reading in the
xml file with the api.

I am trying to clone a host but I seem I see this error

## START ERROR SNIPPET

<opsview>

  <result>

    <detail>Element host failed to validate content

</detail>

    <status>XML-INVALID</status>

  </result>

## END ERROR

 

Here is one the test xml files generated

<opsview>

<authentication>

<username>bob</username>

<password>somepass</password>

</authentication>

<host action="create">

        <clone><name>ms-va-somehost-ms01</name></clone>

        <name>testname2</name>

<ip>10.5.5.6</ip>

<parents>Appdev-sql</parents>

</host></opsview>

 

Has anyone been able to bulk import hosts with parents included?

I suspect Opsview may be griping because the parents I am referencing
don't exist yet which would make some sense, but then it means my perl
script is going to have to get a bit smarter.

 

Has anyone else out there already worked through this through, I like
the challenge but I have plenty of other challenges to tackle already.

 

James Whittington

VC3, Inc.

 

803-978-2723 direct line

803-978-1160 main office

800-422-5941 toll free help desk

 

<<image001.jpg>>

_______________________________________________
Opsview-users mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-users

Reply via email to