Public Server Status Page

Hello, besides uptime, what would you put on a public server status page ?

thanks,

Álvaro

PS - Any idea where to get the uptime info from the server (select on the database provides that ?)

Hi,

  1. registered users and # online users would be nice - for unix there is the ps command to get the uptime of the process or the proc filesystem but to make it more easy I’'d modify the start script to write a time stamp somewhere.

Using a perl script to login and query http://server:9090/index.jsp could also be fine, so you could query other admin pages as well if you don’'t want to write a java plugin which displays such information.

LG

PS: I did post this perl script to login and broadcast in thread.jspa?messageID=116850 some days ago, but as the code tag did change I feel free to post it again so it looks well formatted (:

#!perl.exe #my $version = ''v0.01''; use strict; use warnings; use IO::Socket; use IO::Handle; $|=1; my $message = (defined($ARGV[0]))?"@ARGV":""; my ($buf, $buflen, $buf2); # adjust this my $my_servername = "jabber.org";; my $my_adminport = "9090"; my $my_adminpath = ""; # ''Wifi/'' if you are using Tomcat and ''Wifi.war'', don''t forget the trailing ''/'' my $my_adminuser = "admin"; my $my_password = "private"; my $baseurl = "http://" . $my_servername . ":" . $my_adminport . "/" . $my_adminpath; my $loginpage = "login.jsp";; my $broadcastpage = "user-message.jsp";; my $TRGT_PROTO = ''tcp''; my $HTTP_HEADER = "Host: " . $my_servername . ":" . $my_adminport . "\r\n" . "Content-Type: application/x-www-form-urlencoded\r\n" . "Connection: close\r\n" . "Content-Type: text/html; charset=UTF-8\r\n\r\n"; my $cookie = ""; # login - POST and GET are possible, we will use POST #printf("############# login #############\n"); $buf = "url=/" . $my_adminpath . $broadcastpage . "&"; $buf .= "login=true" . "&"; $buf .= "username=" . $my_adminuser . "&"; $buf .= "password=" . $my_password; $buflen=length($buf); $buf = "POST " . $baseurl . $loginpage . " HTTP/1.0\r\n" . "Content-Length: " . length($buf) . "\r\n" . $HTTP_HEADER . $buf; &send(); &get_cookie(); #printf("############# sending broadcast #############\n"); $message =~ s/\%/\%25/g; $message =~ s/+/\%2b/g; $message =~ s/\&/\%26/g; $buf = "tabs=true" . "&"; $buf .= "send=true" . "&"; $buf .= "message=" . $message; $buflen=length($buf); $buf = "POST " . $baseurl . $broadcastpage . " HTTP/1.0\r\n" . "Content-Length: " . length($buf) . "\r\n" . $cookie . "\r\n" . $HTTP_HEADER . $buf; &send(); #printf("############# success ? #############\n"); if ($buf2 =~ /$broadcastpage\?success=true/) { printf("OK\n"); } else { printf("Error\n"); exit(3); }; exit(0); sub get_cookie() { if ($buf2 =~ /(Cookie\s*:\s*\r\n*;)/) { $cookie = $1; } else { printf("Could not get Cookie / Login"); exit(1); }; #printf("############# Cookie: %s\n", $cookie); }; sub send() { #printf("############# Send: %s\n", $buf); my $sock = new IO::Socket::INET->new(PeerAddr => $my_servername, PeerPort => $my_adminport, Proto => $TRGT_PROTO); if (!defined $sock) { printf("Could not create socket.\n"); exit(2); }; $sock->send($buf); $buf = ""; $buf2 = ""; while (<$sock>) { read($sock, $buf, 1000); $buf2 .= $buf; }; close ($sock); #printf("############# Recv: %s\n", $buf2); };

Thanks for the code! I will evaluate the way to go.

I just took a look at the code and saw that uptime is calculated inside the JVM and doesn’'t get stored anywhere. If a plugin is not to hard to code I will give it a try.

Since no other comments were added I will mark this as answered.

It might be cool to add in all the pretty graphs from Wildfire Enterprise. We’'ll consider a public status page as a new feature.

Thanks,

Matt

Hi,

I just read Matt’'s post - using rrdtool or mrtg to display these values would be really great. If you consider writing a Wildfire plugin you may want to take a look at https://rrd4j.dev.java.net/ while I did not check whether js.com is using the same java rrd package.

The number of created chat rooms (and to make it more tricky the total number of users in these rooms and the avg. number of users / room) could also be very interesting.

LG

I am still trying to figure out how to write a plugin, I can fairly read Java and I do understand its constructs and such things. Would be nice if we had a hello world plugin.

I’'ve looked into http://www.jrobin.org/, not sure I am will ever have the time to start this project though.

JUst found out about Plugin Dev Guide URL, seems that from time to time one must skip the forums and click on those misterious links that say “Documentation”

Hi,

fetch the Wildfire_src.zip file - there is a plugin folder which contains the sources of all plugins (except Asterisk).

LG