Is there a way without using ventrilo_status?

A TeamSpeak 2 server monitor addon based on gllcTS2, and Ventrilo server monitor

Moderator: mdeshane

Is there a way without using ventrilo_status?

Postby AnthonyB » Mon Sep 07, 2009 1:17 pm

Is there a way of doing the Vent status without using ventrilo_status.exe?

Not sure what it's like on a *NIX server but on a Windows server, the amount of security you have to turn off to allow PHP to run a console .exe and parse the output is frightening. Is there any way of doing similar without running an .exe on the local box?
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Is there a way without using ventrilo_status?

Postby mdeshane » Wed Sep 09, 2009 1:45 am

Right now, that is the only official method available for getting the status of a Ventrilo server. There may be some other method I'm not aware of. I'm not sure what effect Windows security has on it, as my UAC has been disabled since shortly after I got Vista RTM, it was too annoying. Though I imagine that if your web server runs under system or an administrative user, you shouldn't have any problems. Of course, if there are you will let me know and we can work on fixes/workarounds. So, in short, the ventrilo_status program is the only method available.
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby AnthonyB » Thu Sep 10, 2009 1:58 pm

Hmmm... well, seems to be frequently posted around the internet that getting it working on Windows servers is near impossible.

I have confirmed paths, permissions, run the .exe from command-line and confirmed the output, verified PHP safe mode is OFF, even turn UAC off but to no avail.
The output is the same with the actual test scripts - http://anthonyb.dyndns.org/ventrilostat ... lotest.php

I did find a reference on another forum of someone that did manage to write a way t get the info without using the .exe:

http://vspy.info/forum/viewtopic.php?f=4&t=172
The script works as is with the english character set no problem and a few strstr functions can tidy up any non english characters with little effort.
But ... (which is a huge "But" in my case because the service does so many scans) the script is up to 4 times slower returning results than the ventrilo_status file.

I get a raw UDP dump via fsockopen. fsockopen( "udp://$ip", $port, $errno, $errstr );
The raw response then gets turned into an array.
I then further sort it into more arrays and finally readable results.

The script does not have any of the bells and whistles that my current scripts have at this stage and has heaps of debug info echo'd throughout which needs to be removed.
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Is there a way without using ventrilo_status?

Postby mdeshane » Thu Sep 10, 2009 4:45 pm

Ok, I couldn't find a download of that script, however I did find another script that does the same thing as ventrilo_status but in pure PHP4. It uses fsockopen and sends raw headers to communicate with vent. I haven't really looked at the script in depth, but I'll probably start trying to integrate that as well, for those that can't get ventrilo_status to execute. I had thought of something like this, but didn't want to re-live my php rcon script night mare. I shudder slightly when I hear UDP now. But this script works with vent 3.0.3 so it should be just what we need. I'll work on it today and hopefully have an update in the SVN tomorrow.
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby AnthonyB » Fri Sep 11, 2009 9:24 am

That'd be awesome!

Another (more) kludgy option I though of was to simply have the vent_status exe scheduled to run every 5 mins and output to text file. Then have the addon open and consume the contents of the text file.

Still, would be a better self-contained option if the fsock UDP call option can be done :)
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Is there a way without using ventrilo_status?

Postby mdeshane » Fri Sep 11, 2009 2:26 pm

I actually got the PHP one to work. It returns all the info the ventrilo_status does. The only downside is that it returns all the info as a single string. So, as soon as I can get all the data sorted into an array we'll be good to go.
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby zanix » Sat Sep 12, 2009 5:54 am

What does the output look like?
Can you post it?
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby mdeshane » Sat Sep 12, 2009 7:38 am

The status string before being parsed and cleaned:
NAME: GuildSpeak Dev Server PHONETIC: GuildSpeak Dev Server COMMENT: AUTH: 0 MAXCLIENTS: 8 VOICECODEC: 0,GSM 6.10 VOICEFORMAT: 1,11 KHz%2C 16 bit UPTIME: 22 PLATFORM: WIN32 VERSION: 3.0.3 CHANNELCOUNT: 0 CLIENTCOUNT: 1 CLIENTFIELDS: ADMIN,CID,PHAN,PING,SEC,NAME,COMM CLIENT: ADMIN=0,CID=0,PHAN=0,PING=-1,SEC=6,NAME=Mike,COMM=


Parsed into:
NAME: GuildSpeak Dev Server
PHONETIC: GuildSpeak Dev Server
COMMENT:
AUTH: 0
MAXCLIENTS: 8
VOICECODEC: 0,GSM 6.10
VOICEFORMAT: 1,11 KHz%2C 16 bit
UPTIME: 22
PLATFORM: WIN32
VERSION: 3.0.3
CHANNELCOUNT: 0
CLIENTCOUNT: 1
CLIENTFIELDS: ADMIN,CID,PHAN,PING,SEC,NAME,COMM
CLIENT:: CLIENT: ADMIN=0,CID=0,PHAN=0,PING=-1,SEC=6,NAME=Mike,COMM=
Client Fields: Array ( [0] => ADMIN [1] => CID [2] => PHAN [3] => PING [4] => SEC [5] => NAME [6] => COMM )
Client Array: Array ( [CID] => 0 [PHAN] => 0 [PING] => -1 [SEC] => 6 [NAME] => Mike [COMM] => [ADMIN] => 0 )
Clients: Array ( [1] => Array ( [ADMIN] => 0 [CID] => 0 [PHAN] => 0 [PING] => -1 [SEC] => 6 [NAME] => Mike [COMM] => ) )

It's Copy+Paste straight from the browser. Is that what you're looking for?
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby AnthonyB » Sat Sep 12, 2009 1:05 pm

Awesome :)

My page - http://anthonyb.dyndns.org/roster/index ... guildspeak

So, what I get displayed is:
Code: Select all
NAME: Order of Assassins Backup Vent PHONETIC:
PHONETIC: COMMENT:
COMMENT: AUTH: 1
AUTH: 1 MAXCLIENTS: 100
MAXCLIENTS: 100 VOICECODEC: 3,Speex
VOICECODEC: 3,Speex VOICEFORMAT: 23,32 KHz%2C 16 bit%2C 1 Qlty
VOICEFORMAT: 23,32 KHz%2C 16 bit%2C 1 Qlty UPTIME: 169886
UPTIME: 169886 PLATFORM: WIN32
PLATFORM: WIN32 VERSION: 3.0.2
VERSION: 3.0.2 CHANNELCOUNT: 0
CHANNELCOUNT:
CLIENTCOUNT:
CLIENTFIELDS:
CLIENT::
Client Fields: Array ( [0] => )
Client Array: Array ( )
Clients:


Am also getting some PHP errors as follows:

Code: Select all
PHP Errors
addons\guildspeak\index.php
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 161: Undefined offset: 3
  Notice line 200: Undefined variable: clients
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Is there a way without using ventrilo_status?

Postby mdeshane » Sat Sep 12, 2009 3:25 pm

it looks like it's having problems with the preg_match_all() which is supposed to grab the next key in the array and remove it from each array value after a successful match. Which is why it looks like:
NAME: Order of Assassins Backup Vent PHONETIC:
instead of
NAME: Order of Assassins Backup Vent

It seems I deleted the whistespace regex from that chunk of code. I'll write it back in and that should solve the undefined offset and cleanup the display. And I believe the Notice line 200: Undefined variable: clients error is due to the clients array being defined in a foreach loop. I define it outside the loop first and see if that fixes it.
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby mdeshane » Sat Sep 12, 2009 4:01 pm

Updated the SVN with those fixes. The changelog info is below:

GuildSpeak v1.9.9.7 [SVN]471:
-Fixed
-- Vent Status String parsing in index.php to add white space before the key, and declare the clients array outside foreach loop
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby zanix » Sun Sep 13, 2009 1:37 am

That is one wicked string
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby mdeshane » Sun Sep 13, 2009 3:03 am

Here's another version of the string where the keys are replaced with numbers (Detail Mode 7 in Vent Config):
00GuildSpeak Dev Server 01GuildSpeak Dev Server 02 030 048 050,GSM 6.10 061,11 KHz%2C 16 bit 0758 08WIN32 093.0.3 100 121 13010,020,030,040,0537,06Mike,07


I think that string might be easier to parse knowing what the keys are. But I just discovered that output earlier today. Just have to map the numbers to the array keys:
NAME => 00
PHONETIC => 01
COMMENT => 02
AUTH => 03
MAXCLIENTS => 04
VOICECODEC => 05
VOICEFORMAT => 06
UPTIME => 07
PLATFORM => 08
VERSION => 09
CHANNELCOUNT => 10
CLIENTCOUNT => 12
CLIENTFIELDS => ?
CLIENT => 13

Then it starts back at 01 for the client fields after 13.
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Re: Is there a way without using ventrilo_status?

Postby AnthonyB » Sun Sep 13, 2009 4:08 am

Have updated to GuildSpeak v1.9.9.7 [SVN]471

http://anthonyb.dyndns.org/roster/index ... eak&a=g:17

So, when no-one is logged in I get the following:
Code: Select all
NAME: Order of Assassins Backup Vent PHONETIC:
PHONETIC: COMMENT:
COMMENT: AUTH: 1
AUTH: 1 MAXCLIENTS: 100
MAXCLIENTS: 100 VOICECODEC: 3,Speex
VOICECODEC: 3,Speex VOICEFORMAT: 23,32 KHz%2C 16 bit%2C 1 Qlty
VOICEFORMAT: 23,32 KHz%2C 16 bit%2C 1 Qlty UPTIME: 224074
UPTIME: 224074 PLATFORM: WIN32
PLATFORM: WIN32 VERSION: 3.0.2
VERSION: 3.0.2 CHANNELCOUNT: 0
CHANNELCOUNT:
CLIENTCOUNT:
CLIENTFIELDS:
CLIENT::
Client Fields: Array ( [0] => )
Client Array: Array ( )
Clients: Array ( )


..and no PHP errors :)

It gets interesting when someone is logged in though...

Code: Select all
NAME: Order of Assassins Backup Vent PHONETIC:
PHONETIC: COMMENT:
COMMENT: AUTH: 1
AUTH: 1 MAXCLIENTS: 100
MAXCLIENTS: 100 VOICECODEC: 3,Speex
VOICECODEC: 3,Speex VOICEFORMAT: 23,32 KHz%2C 16 bit%2C 1 Qlty
VOICEFORMAT: 23,32 KHz%2C 16 bit%2C 1 Qlty UPTIME: 224215
UPTIME: 224215 PLATFORM: WIN32
PLATFORM: WIN32 VERSION: 3.0.2
VERSION: 3.0.2 CHANNELCOUNT: 0
CHANNELCOUNT: 0 CLIENTCOUNT: 1
CLIENTCOUNT: 1 CLIENTFIELDS: ADMIN,CID,PHAN,PING,SEC,NAME,COMM
CLIENTFIELDS: CLIENTFIELDS: ADMIN,CID,PHAN,PING,SEC,NAME,COMM CLIENT: ADMIN=0,CID=0,PHAN=0,PING=-1,SEC=3,NAME=Ransin,COMM=
CLIENT:: CLIENT: ADMIN=0,CID=0,PHAN=0,PING=-1,SEC=3,NAME=Ransin,COMM=
Client Fields: Array ( [0] => CLIENTFIELDS: ADMIN [1] => CID [2] => PHAN [3] => PING [4] => SEC [5] => NAME [6] => COMM CLIENT: ADMIN=0 [7] => CID=0 [8] => PHAN=0 [9] => PING=-1 [10] => SEC=3 [11] => NAME=Ransin [12] => COMM= )
Client Array: Array ( [CID] => 0 [PHAN] => 0 [PING] => -1 [SEC] => 3 [NAME] => Ransin [COMM] => [ADMIN] => 0 )
Clients: Array ( [1] => Array ( [CLIENTFIELDS: ADMIN] => [CID] => 0 [PHAN] => 0 [PING] => -1 [SEC] => 3 [NAME] => Ransin [COMM CLIENT: ADMIN=0] => [CID=0] => [PHAN=0] => [PING=-1] => [SEC=3] => [NAME=Ransin] => [COMM= ] => ) )


and some PHP errors

Code: Select all
PHP Errors
addons\guildspeak\index.php
  Notice line 187: Undefined index: CLIENTFIELDS: ADMIN
  Notice line 187: Undefined index: COMM CLIENT: ADMIN=0
  Notice line 187: Undefined index: CID=0
  Notice line 187: Undefined index: PHAN=0
  Notice line 187: Undefined index: PING=-1
  Notice line 187: Undefined index: SEC=3
  Notice line 187: Undefined index: NAME=Ransin
  Notice line 187: Undefined index: COMM= 
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Is there a way without using ventrilo_status?

Postby mdeshane » Sun Sep 13, 2009 4:33 am

That's odd, it doesn't seem to be cleaning and parsing the array properly in either case. That's what's causing the errors when there are users logged in. As line 187 is where it inserts the client data into the $clients array from the $clientarr array, and it's erroring because the array keys aren't matching. I'll start working on a parser for the detail mode 7 output, perhaps that will parse better without errors.

What Detail Mode are you using and what PHP version are you running?
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Next

Return to GuildSpeak

Who is online

Users browsing this forum: No registered users and 0 guests

cron