--- php/hawk.php.orig 2001-11-08 21:58:52.000000000 +0000
+++ php/hawk.php 2012-02-05 12:09:21.000000000 +0000
@@ -10,6 +10,7 @@
# map these variables
$sortby=$HTTP_POST_VARS["sortby"];
$network=$HTTP_POST_VARS["network"];
+ $for_rev_check=$HTTP_POST_VARS["for_rev_check"];
$showeverydamnthing=$HTTP_POST_VARS["showeverydamnthing"];
$sortoptions = array (
@@ -38,6 +39,18 @@
print "\n";
+ print "
";
+
+ if ($for_rev_check || ($for_rev_check_default && !$network)) {
+ $checked = "checked";
+ }
+ else {
+ $checked = "";
+ }
+ checkbox("for_rev_check", $checked);
+ print " Indicate if the forward and reverse hostnames match.";
+ print "
";
+
if ($showeverydamnthing) {
$checked = "checked";
}
@@ -51,7 +64,6 @@
print "";
# href("#key", "Key");
- print "
";
# show everything until network selection is implemented
if ($network) {
@@ -70,7 +82,7 @@
#####################################################
function shownet ($network) {
- global $dbuser, $dbpass, $dbhost, $dbname, $redzone, $yellowzone, $sortby, $showeverydamnthing;
+ global $dbuser, $dbpass, $dbhost, $dbname, $redzone, $yellowzone, $sortby, $for_rev_check, $showeverydamnthing, $purple_string;
if (!$link=@mysql_connect($dbhost, $dbuser, $dbpass)) {
$errormsg = mysql_error();
print urlencode($errormsg);
@@ -87,10 +99,10 @@
# select them all for now
if ($sortby == ip) {
- $query = "select ip, hostname, lastping from hawk.ip order by inet_aton(ip)";
+ $query = "select ip, hostname, lastping, for_rev_match from hawk.ip order by inet_aton(ip)";
}
else {
- $query = "select ip, hostname, lastping from hawk.ip order by '$sortby'";
+ $query = "select ip, hostname, lastping, for_rev_match from hawk.ip order by '$sortby'";
}
if (!$result = @mysql_query($query)) {
@@ -110,7 +122,7 @@
extract ($record);
# only show blank ping/hostname records if $showeverydamnthing is set
- if ($hostname == "" && $lastping == 0 && !$showeverydamnthing) continue 1;
+ if ((!$hostname || strstr($hostname, $purple_string)) && !$lastping && !$showeverydamnthing) continue 1;
if (!testip($network, $ip)) continue 1;
@@ -126,24 +138,28 @@
print "
Key: | "; - img("images/greensphere.png", 10, 10); + img("images/greensphere.png", 10, 10, "green"); print " Host in DNS. Recent ping response. | |
"; + img("images/questionsphere.png", 10, 10, "question"); + print " Host in DNS. Forward and reverse hostnames do not match. | ||
"; - img("images/yellowsphere.png", 10, 10); + img("images/yellowsphere.png", 10, 10, "yellow"); print " Host in DNS. No ping response for over $yellowzone seconds. | ||
"; - img("images/redsphere.png", 10, 10); + img("images/redsphere.png", 10, 10, "red"); print " Host in DNS. No ping response for over $redzone seconds. | ||
"; - img("images/purplesphere.png", 10, 10); + img("images/purplesphere.png", 10, 10, "purple"); print " Host not in DNS. No ping response. | ||
"; - img("images/bluesphere.png", 10, 10); + img("images/bluesphere.png", 10, 10, "blue"); print " Host not in DNS. Recent ping response. |