1

I have been working on a web monitor using sigar to gather the System information, but now i need to get the Oracle's RAM and CPU usage. I did it using sigar.getProcCpu(pid).getTotal() function.

But when i deploy the app on glassfish 4, i get the error message: org.hyperic.sigar.SigarPermissionDeniedException: Access is denied.

is there any walkaround for this? can i give sigar access to the info that im requesting?

JoseGarcia
  • 11
  • 1

1 Answers1

1

I got exact the same problem as yours. I found this post after I asked my question and find my answer. And here's my answer for my own question:

The OS does not allow your program to access process information until you run the program with Admin privilege, so I need to provide Admin privilege.

There are some methods to provide Admin privilege, including ask user to right click on the icon and select "run as administrator".

But the better way might be wrapping your java application in an .exe like here and here said.

However, I probably have to hack the OS as excowboy said here as I want to show the information on web page and can't wrapping my app in an .exe file.

I think I have to give up. Just put these links for those who may need it. :) Oh, the total CPU usage is accessible if you want,BTW.

Hope this would help you and sorry for my poor English. ;)

Community
  • 1
  • 1
nosnhoj
  • 793
  • 1
  • 12
  • 30