#!/usr/bin/php (string)$xml->CURRENTLISTENERS, 'PEAKLISTENERS' => (string)$xml->PEAKLISTENERS, 'MAXLISTENERS' => (string)$xml->MAXLISTENERS, 'UNIQUELISTENERS' => (string)$xml->UNIQUELISTENERS, ); // this is the usual case, generating a label and value echo("max_connections.value {$dnas_data['MAXLISTENERS']}\n"); echo("ax_used_connections.value {$dnas_data['PEAKLISTENERS']}\n"); echo("all_connections.value {$dnas_data['CURRENTLISTENERS']}\n"); echo("unique_connections.value {$dnas_data['UNIQUELISTENERS']}\n"); } else { $dnas_data = array('ERROR' => 'Could not connect to dnas-server!'); echo("\n"); } // this is for munin's configuration tool // could do something more complicated here if(count($argv) == 2 && $arv[1] == 'authconf') { exit('yes'); } // this is for rrdtool to know how to label the graph // Default Settings if(count($argv) == 2 && $argv[1] == 'config') { echo("graph_title SHOUTcast Online on GlobalMobile port 8026\n"); echo("graph_args --base 1000\n"); echo("graph_category shoutcast\n"); echo("graph_vlabel Connections per \${graph_period}\n"); // Max Listeners Allowed to Connect to Server echo("max_connections.draw AREA\n\n"); echo("max_connections.colour cdcfc4\n"); echo("max_connections.min 0\n"); echo("max_connections.label Max Slots\n"); echo("max_connections.type GAUGE\n"); // Peak Listeners echo("ax_used_connections.draw AREA\n"); echo("ax_used_connections.colour ffd660\n"); echo("ax_used_connections.min 0\n"); echo("ax_used_connections.label Peak Listeners\n"); echo("ax_used_connections.type GAUGE\n"); // Max Listeners Connected to Server echo("all_connections.draw LINE1\n"); echo("all_connections.colour a00e95\n"); echo("all_connections.min 0\n"); echo("all_connections.label Listeners\n"); echo("all_connections.type GAUGE\n"); // Max Unique Listeners Connected to Server echo("unique_connections.draw LINE1\n"); echo("unique_connections.colour 330099\n"); echo("unique_connections.min 0\n"); echo("unique_connections.label Unique Listeners\n"); echo("unique_connections.type GAUGE\n"); exit(); } //closing the connection curl_close($ch); ?>