I am new to Java and using Netbeans IDE 7.1.2, need to retrieve alerts based on time interval.
I added hqapi1-4.2.0.jar to the libraries of my Application project. I also added it as web service..
code:
public class GetHQAlerts {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
HQApi api = new HQApi("10.2.3.7", 7080, false, "hqadmin", "hqadmin");
try
{
AlertApi alertapi = api.getAlertApi();
AlertsResponse alertRes = alertapi.findAlerts(1336713917, 1337713917, 1, 3, true, false);
System.out.println("result is " + alertRes.getAlert().get(0).getName());
}
catch (IOException err)
{
System.out.println(err.getMessage());
}
}
When trying to test and run, i got this error:
run:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/Credentials
at org.hyperic.hq.hqapi1.HQApi.<init>(HQApi.java:65)
at gethqalerts.GetHQAlerts.main(GetHQAlerts.java:25)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.Credentials
My Goal was to :
to export alerts into a database so that we can merge with other alerts from other systems. Perhaps there's a better/faster way???
any help would be appreciated.
thanks
Grace
Hello,
Your post was moved to the Hyperic Developer FOrums.
Best regards,
Edward L. Haletky
VMware Communities User Moderator, VMware vExpert 2009, 2010, 2011, 2012
Author of the books 'VMWare ESX and ESXi in the Enterprise: Planning Deployment Virtualization Servers', Copyright 2011 Pearson Education. 'VMware vSphere and Virtual Infrastructure Security: Securing the Virtual Environment', Copyright 2009 Pearson Education.
vSphere Upgrade Saga -- Virtualization Security Round Table Podcast -- The Virtualization Practice