Renzo's Zabbix Tricks


Zabbix is a very powerfull monitoring tool that is highly flexible and supports many hardware units.

Listed below is the solutions i made in my use with the product.

How to get requests/sec og busy workers from server-status in Apache 2.0
How to get current number of sessions/users in proftpd into zabbix

How to get requests/sec og busy workers from server-status in Apache 2.0



First change to apache.conf to allow localhost to get the server-status
# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your_domain.com" to match your domain to enable.
#
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost
</Location>

ExtendedStatus On
		
Write a PHP based CLI commaind script like this:
#!/usr/bin/php -q
<?php
		$thestats = file("http://localhost/server-status?auto");


		if ($argv[1] == "1") {
				print substr(strstr($thestats[4],":"),2);
		} else {
				print substr(strstr($thestats[7],":"),2);
		}

?>
		
Finally add this to the zabbix_agentd.conf
# Apache avg. request/sec
UserParameter=apache[rps],getApacheStats.sh.php 1
UserParameter=apache[runningproc],getApacheStats.sh.php 2
		

How to get current number of sessions/users in proftpd into zabbix



First we need a PHP based script to obtain the info. Place it in a command path, like /usr/local/bin or /usr/bin
		#!/usr/bin/php
		<?php

			$retval = exec('ps ax | grep proftpd | wc -l');
			$newval = intval($retval)-2;
			echo $newval."\n";

		?>
		
Add this to zabbix conf:
UserParameter=proftpd[users],/usr/bin/countftp.php
Or whatever you named the PHP script

How to easily convert .ts files to Mpeg2 or DVD

So you finally got the recording features to work on your DreamBox, but you want more? :-)

Flash UnicodeTable converter

Upload a UTF-8 based txt file with the chars within, and I will convert it into a valid UnicodeTable Flash XML file, for instant use.

Zabbix tips

Get Apache reqs/sec, mysql connections, proftpd connection into Zabbix.