Example #1
0
 include_once "./lib/jpgraph/src/jpgraph_pie3d.php";
 $result = dbquery($sql);
 if (!mysql_num_rows($result) > 0) {
     die("Error: no rows retrieved from database\n");
 }
 $relay_array = array();
 while ($row = mysql_fetch_object($result)) {
     $data[] = $row->count;
     $hostname = gethostbyaddr($row->clientip);
     if ($hostname == $row->clientip) {
         $data_names[] = "(Hostname lookup failed)";
     } else {
         $data_names[] = $hostname;
     }
     $data_ip[] = $row->clientip;
     if ($geoip = return_geoip_country($row->clientip)) {
         $data_geoip[] = $geoip;
     } else {
         $data_geoip[] = "(GeoIP lookup failed)";
     }
     $data_virus[] = $row->total_viruses;
     $data_spam[] = $row->total_spam;
     $data_size[] = $row->size;
 }
 $graph = new PieGraph(800, 385, 0, false);
 $graph->SetShadow();
 $graph->img->SetAntiAliasing();
 $graph->title->Set("Top 10 Mail Relays");
 //$graph->legend->SetLayout(LEGEND_HOR);
 $graph->legend->Pos(0.52, 0.87, 'center');
 $p1 = new PiePlot3d($data);
Example #2
0
 $output .= ' <th>' . __('all04') . '</th>' . "\n";
 $output .= ' </tr>' . "\n";
 if (is_array($relays = get_mail_relays($row[$f]))) {
     foreach ($relays as $relay) {
         $output .= ' <tr>' . "\n";
         $output .= ' <td>' . $relay . '</td>' . "\n";
         // check if ipv4 has a port specified (e.g. 10.0.0.10:1025), strip it if found
         $relay = stripPortFromIp($relay);
         // Reverse lookup on address. Possibly need to remove it.
         if (($host = gethostbyaddr($relay)) != $relay) {
             $output .= " <td>{$host}</td>\n";
         } else {
             $output .= " <td>(Reverse Lookup Failed)</td>\n";
         }
         // Do GeoIP lookup on address
         if ($geoip_country = return_geoip_country($relay)) {
             $output .= ' <td>' . $geoip_country . '</td>' . "\n";
         } else {
             $output .= ' <td>(GeoIP Lookup Failed)</td>' . "\n";
         }
         // Link to RBL Lookup
         $output .= ' <td align="center">[<a href="http://www.mxtoolbox.com/SuperTool.aspx?action=blacklist:' . $relay . '">&nbsp;&nbsp;</a>]</td>' . "\n";
         // Link to Spam Report for this relay
         $output .= ' <td align="center">[<a href="rep_message_listing.php?relay=' . $relay . '&amp;isspam=1">&nbsp;&nbsp;</a>]</td>' . "\n";
         // Link to Virus Report for this relay
         $output .= ' <td align="center">[<a href="rep_message_listing.php?relay=' . $relay . '&amp;isvirus=1">&nbsp;&nbsp;</a>]</td>' . "\n";
         // Link to All Messages Report for this relay
         $output .= ' <td align="center">[<a href="rep_message_listing.php?relay=' . $relay . '">&nbsp;&nbsp;</a>]</td>' . "\n";
         // Close table
         $output .= ' </tr>' . "\n";
     }