Hi!
We are interested in the possibility of obtaining from the admin panel on the server side parameters such as: use of CPU, Memory, Extension Message Queue count, system message queue count, the number of players.
We want to make an utility for nagios. Our support team needs these parameters for server monitoring.
How we can obtain these parameters from SFS server?
Thanks.
Obtaining parameters from the admin panel
Re: Obtaining parameters from the admin panel
Hi,
CPU and Memory are coming directly from the JVM:
http://stackoverflow.com/questions/4717 ... ge-in-java
That depends on the Zone. You can have one or many... so first you need to select the zones that you want to check
Zone zone = SmartFoxServer.getInstance().getZoneManager().getZoneByName("myZone");
zone.getUserCount();
cheers
CPU and Memory are coming directly from the JVM:
http://stackoverflow.com/questions/4717 ... ge-in-java
Extension Message Queue count:
Code: Select all
BitSwarmEngine.getInstance().getControllerManager().getControllerById(0).getQueueSize();
system message queue count
Code: Select all
BitSwarmEngine.getInstance().getControllerManager().getControllerById(1).getQueueSize();
the number of players
That depends on the Zone. You can have one or many... so first you need to select the zones that you want to check
Zone zone = SmartFoxServer.getInstance().getZoneManager().getZoneByName("myZone");
zone.getUserCount();
cheers
Re: Obtaining parameters from the admin panel
Oh wait... I noticed you posted under the SFS PRO section, but my reply is valid for SFS2X
Are you asking for SFSPRO?
Are you asking for SFSPRO?
Re: Obtaining parameters from the admin panel
Lapo wrote:Oh wait... I noticed you posted under the SFS PRO section, but my reply is valid for SFS2X
Are you asking for SFSPRO?
No, i asked about 2x.
Missed thread, sorry
Thanks
Re: Obtaining parameters from the admin panel
Moved, no problem
Re: Obtaining parameters from the admin panel
Lapo wrote:Hi,Extension Message Queue count:Code: Select all
BitSwarmEngine.getInstance().getControllerManager().getControllerById(0).getQueueSize();
system message queue countCode: Select all
BitSwarmEngine.getInstance().getControllerManager().getControllerById(1).getQueueSize();
getControllerById(0) and getControllerById(1) return null value.
What im doing wrong?
Re: Obtaining parameters from the admin panel
try using this:
getControllerById((byte) 0); and getControllerById((byte) 1)
I am going by memory... the controller ID should be a byte.
getControllerById((byte) 0); and getControllerById((byte) 1)
I am going by memory... the controller ID should be a byte.
Re: Obtaining parameters from the admin panel
Lapo wrote:try using this:
getControllerById((byte) 0); and getControllerById((byte) 1)
I am going by memory... the controller ID should be a byte.
It works! Thanks.
Who is online
Users browsing this forum: Baidu [Spider] and 118 guests