Hylafax monitoring script

If you use HylaFax, I’ve written a little php script to monitor my IAX modems and fax status. It refreshes every 10 seconds…

[root@srv-a html]# cat fax-status.php
<?php
$page = $_SERVER['PHP_SELF'];
$sec="10";
header("Refresh: $sec; url=$page");
echo "<H1>Fax Statistics</H1>";
echo "<table border=0 cellpadding='10'><tr><td valign='top'>";
echo "<h2>Fax Modem Status</h2>";
$output2 = htmlspecialchars(shell_exec('faxstat -s'));
echo "<pre>$output2</pre>";
$output1 = htmlspecialchars(shell_exec('faxstat -r | tail -20'));;
echo "<h2>Last 20 Received</h2>";
echo "<pre>Protect Page  Owner        Sender/TSI  Recvd@ Filename<br />";
echo "$output1</pre>";
$output1 = htmlspecialchars(shell_exec('faxstat -d -n| tail -20'));;
<pre    echo "<h2>Recent Sends</h2>";
echo "<pre>";
echo "$output1</pre>";

function stripLine($text)
{
        return substr( $text, strpos($text, "\n")+1 );
}
?>

… the output looks like this.

1 Like

This is cool. If you want to donate it to the cause, submit it on a feature request ticket and get the code submission paperwork signed and returned so it can be integrated/made available.

1 Like