Quantcast

Agent access to sigar

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Agent access to sigar

lukestephenon
Hi Yan,

For unix hosts, we have some basic host monitoring following the pattern outlined on your post http://www.pongasoft.com/blog/yan/glu/2011/03/18/building-monitoring-solution-with-glu/

For windows, obtaining host load averages is not trivial.  Sigar provides this.  Is there a way for the glu script to access sigar?

Thanks

Luke
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent access to sigar

frenchyan
Administrator
This is how the agent loads Sigar when it boots: https://github.com/pongasoft/glu/blob/master/agent/org.linkedin.glu.agent-server-impl/src/main/groovy/org/linkedin/glu/agent/server/AgentMain.groovy#L773

So although Sigar is not accessible as something passed in, you can always use it by creating an instance of it in your script since the script will run in the same VM in which the agent is running:

Sigar sigar = new Sigar()

Yan
PS: don't forget to import it: import org.hyperic.sigar.Sigar
Loading...