Obtaining parameters from the admin panel

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
Zed
Posts: 40
Joined: 03 Jul 2014, 15:24

Obtaining parameters from the admin panel

Post by Zed »

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.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Obtaining parameters from the admin panel

Post by Lapo »

Hi,
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
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Obtaining parameters from the admin panel

Post by Lapo »

Oh wait... I noticed you posted under the SFS PRO section, but my reply is valid for SFS2X :)

Are you asking for SFSPRO?
Lapo
--
gotoAndPlay()
...addicted to flash games
Zed
Posts: 40
Joined: 03 Jul 2014, 15:24

Re: Obtaining parameters from the admin panel

Post by Zed »

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 :)
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Obtaining parameters from the admin panel

Post by Lapo »

Moved, no problem
Lapo
--
gotoAndPlay()
...addicted to flash games
Zed
Posts: 40
Joined: 03 Jul 2014, 15:24

Re: Obtaining parameters from the admin panel

Post by Zed »

Lapo wrote:Hi,
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();
getControllerById(0) and getControllerById(1) return null value.
What im doing wrong?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Obtaining parameters from the admin panel

Post by Lapo »

try using this:
getControllerById((byte) 0); and getControllerById((byte) 1)

I am going by memory... the controller ID should be a byte.
Lapo
--
gotoAndPlay()
...addicted to flash games
Zed
Posts: 40
Joined: 03 Jul 2014, 15:24

Re: Obtaining parameters from the admin panel

Post by Zed »

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.
Post Reply