vCenter

 View Only
  • 1.  HqAPI assistance needed - Problems with CLI commands

    Posted Mar 20, 2009 03:30 AM
    Hello I am evaluating the latest version of the opensource HypericHQ and I am currently trying to add new platforms to the system via the command line API tools. I am getting the error message below.
    "Error running command: The given object already exists"

    The command I am executing from the localhost which is also running the agent and hyperic-hq server. I can setup and use the ICMP Ping fine when I do it all via the web gui and it monitors just fine and collects the metrics but when I try and add another new unique host I get the error message.

    /hqapi.sh resource createPlatform --prototype="ICMP Ping" --agentId=10001 --fqdn=dallas33.xxxx.net --ip=208.xxx.xxx.xx2 --name=dallas33.xxxx.net --host="127.0.0.1" --user="hqadmin" --password="hqadmin" --port="8080"

    Note I have the gui listening on port 8080 instead of the default 8070 and I am not 100% sure I am using the correct agentId number for the single agent I am running. Could anyone assist me in finding out which portion of the above object already exists and secondly how can I properly identify the agentID number? Also is there a way to get a more verbose output from the hqapi.sh CLI commands.

    Thanks,

    Jeremy


  • 2.  RE: HqAPI assistance needed - Problems with CLI commands

    Posted Mar 20, 2009 03:43 AM
    I have figured out how to find the agentId. Could still use some help with the existing object error. I also created a client.preferences file as noted in the API docs and that is making it easier.

    Incase anyone ever needs the command its below.

    ./hqapi.sh agent list
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <AgentsResponse>
    <Status>Success</Status>
    <Agent unidirectional="false" version="4.1.0" port="2144" address="72.233.xx.xx" id="10001"/>
    </AgentsResponse>

    Basically I need an easy way via shell to setup several thousand IP's to be monitored by ICMP PING. Any suggestions?

    Message was edited by: JAnttila


  • 3.  RE: HqAPI assistance needed - Problems with CLI commands

    Posted Mar 20, 2009 04:16 AM
    I may have figured this out. Can someone please confirm this is the best method to add a large amount of hosts that need basic ping tests.

    ./hqapi.sh resource createService --prototype="ICMP Ping" --resourceId=10629 --name=dallas3.xxxx.net -- ip=208.xxx.xxx.xx2 name=dallas3.xxxx.net count=3 ping="/bin/ping" switch="-c" hostname="dallas3.xxx.net"

    -Jeremy


  • 4.  RE: HqAPI assistance needed - Problems with CLI commands

    Posted Mar 21, 2009 01:50 PM
    That's right. Your previous attempt was trying to call createPlatform
    to create a service.

    Charles