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

Zed
Posts: 37
Joined: 03 Jul 2014, 15:24

Obtaining parameters from the admin panel

Postby Zed » 18 Aug 2015, 13:42

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: 19985
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Obtaining parameters from the admin panel

Postby Lapo » 18 Aug 2015, 14:28

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: 19985
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Obtaining parameters from the admin panel

Postby Lapo » 18 Aug 2015, 14:43

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: 37
Joined: 03 Jul 2014, 15:24

Re: Obtaining parameters from the admin panel

Postby Zed » 18 Aug 2015, 15:25

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: 19985
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Obtaining parameters from the admin panel

Postby Lapo » 18 Aug 2015, 16:13

Moved, no problem
Lapo

--

gotoAndPlay()

...addicted to flash games
Zed
Posts: 37
Joined: 03 Jul 2014, 15:24

Re: Obtaining parameters from the admin panel

Postby Zed » 19 Aug 2015, 14:14

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: 19985
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Obtaining parameters from the admin panel

Postby Lapo » 19 Aug 2015, 14:33

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: 37
Joined: 03 Jul 2014, 15:24

Re: Obtaining parameters from the admin panel

Postby Zed » 20 Aug 2015, 13:44

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.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 8 guests