As an avid OpenBSD user, I use OpenBSD for virtually everything...including a great deal of mass web/email hosting. I use the symon/symux packages by Willem Dijkstra to monitor system performance, but the graphs produced by syweb don't provide a nice up-to-the-second overview of things (plus I loathe putting a shell in my chroot'ed apache). Sometimes it's nice to have a brief overview of things, and existing projects such as phpSysInfo don't work well on OpenBSD...and that motivated me to write phpsymon.
phpsymon is a simple PHP script that listens on the address and port (default 127.0.0.1 and 2100, respectively) that symon streams its output to. Once the stats are grabbed, it parses the output into an easy-to-read overview of things.
phpsymon is FREE software, distributed under the BSD license.
phpsymon v2.0 can be downloaded here:
phpsymon.tar.gz.
To install, simply unzip in the web-directory you want to view the stats in.
# cd /var/www/htdocs
# tar xzf /path/to/download/phpsymon.tar.gz
This will create a new directory phpsymon that you can point your
browser at to view everything. This directory includes the following files.
Modify the file config/config.php if you want phpsymon to connect
to a host other than 127.0.0.1 and port 2100.
After that, point your browser to the configtest.php script, to
see if everything works.
Options configurable on phpsymon are:
The following are 2 screenshots of phpsymon. The first is a
snapshot from of my firefox window showing only what fits in the window.
The second shows the entire phpsymon display.
Click each for full-size version.
You can view a live example of phpsymon here. This demo may not stay up permanently for the public.
[error] PHP Warning: socket_connect(): unable to connect [61]: Connection refused in /path/to/symon/symon.php on line 43
What gives?
monitor { cpu(0), mem, pf, mbuf, ... } stream to 192.168.1.1 2100
And something like the following in /etc/symux.conf on host
picard:
mux 192.168.1.1 2100
# accept symon stats from host "data"
source 192.168.1.10 {
accept { cpu(0), mem, pf, mbuf, ... }
datadir "/var/www/symon/rrds/data"
}
# accept symon stats from host "worf"
source 192.168.1.11 {
accept { cpu(0), mem, pf, mbuf, ... }
datadir "/var/www/symon/rrds/worf"
}
Now, in the phpsymon file config/config.php, you
should have the following variables set as you see them:
$config['SymuxAddress'] = "192.168.1.1";
$config['SymuxPort'] = "2100";
$config['SymonHost'] = "192.168.1.10";
The first two variables instruct phpsymon to read stats
from host picard on the appropriate port. The third variable,
tells phpsymon which host to display information from.
ryan@godel# telnet 192.168.1.1 2100 Trying 192.168.1.1... Connected to 192.168.1.1. Escape character is '^]'. 192.168.1.10;io:cd1:1126931708:0:0:0:0:0;io:cd0:1126931708:0:0:0:0:0;io:wd0:11269 31708:3674918:11894382:0:91278661120:190547191296;proc:httpd:1126931708:21:11222 :3835:218:119:0.00:162471936:0;if:sis1:1126931708:8991240:10262738:598651475:771 310954:17067:3:0:0:1663440:0;if:sis0:1126931708:11632076:10175231:4117005601:164 8118281:50513:1:0:0:0:0;if:lo0:1126931708:1436865:1436865:1033785094:1033785094: 0:0:0:0:0:0;mbuf::1126931708:297:204:0:0:61:0:32:0:196:250:618496:77:0:0:12;pf:: 1126931708:8191271922:5661534388:0:352:11354245:227308:10172162:18269:0:0:1:4:56 7:44138834:1403370:1402803:4519156:0:9:0:1:0;mem::1126931708:137121792:209858560 :180875264:96780288:1073995776;cpu:0:1126931708:0.30:0.00:0.60:0.00:99.10; 192.168.1.11;io:wd0:1126925734:5163711:127683:0:327717384704:3833036800;proc:mys qld:1126925734:1:338126:968281:15584:13219:0.00:77176832:47833088;if:gem0:112692 5734:1707592:5024602:996008551:1940494606:19361:5:0:0:1279589:0;if:lo0:112692573 4:1593:1593:327877:327877:0:0:0:0:0:0;mbuf::1126925734:173:128:0:0:38:0:7:0:128: 208:532480:57:0:0:0;mem::1126925734:56451072:162463744:1020313600:0:314818560;cp u:0:1126925734:0.60:0.00:1.40:0.00:98.00; ^] telnet>Each line of output corresponds to symon stats from a host, and the first word of each is line is the IP of the host. So...