[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ossec-cvs] ossec-hids: hostInfo.php (HEAD) [davelowe]



Module name:	ossec-hids
Changes by:	davelowe	07/07/19 06:57:27

Modified files:
	hostInfo.php

Log message:
Displaying host information for selected host

Index: hostInfo.php
===================================================================
RCS file: /usr/cvsroot/ossec-ui/ossec/Site/hostInfo.php,v
diff -u -r1.1 -r1.2
--- hostInfo.php	11 Jul 2007 02:05:19 -0000	1.1
+++ hostInfo.php	19 Jul 2007 09:57:27 -0000	1.2
@@ -4,27 +4,45 @@
 $atitle = "";
 $aid = "";
 $amsg = "";
-/* If agent is connected */
-if($agent{'connected'})
+/* Check to see if a host has been selected */
+if(isset($_GET['selectHost']))
 {
-$atitle = "Agent active";
-$aid = "bluez";
+        $USER_host = $_GET['selectHost'];
+        if($USER_host == "All"){
+                $USER_host = "*";
+        }
 }
 else
 {
-$atitle = "Agent Inactive";
-$aid ="red";
-$amsg = " - Inactive";
+        /* preg match all hosts */
+        $USER_host = "*";
+}
+foreach ($agent_list as $agent)
+{
+        if(trim($agent{'name'}) == $USER_host)
+        {
+                /* If agent is connected */
+                if($agent{'connected'})
+                {
+                        $atitle = "Agent active";
+                }
+                else
+                {
+                        $atitle = "Agent Inactive";
+                        $amsg = " - Inactive";
+                }
+                echo '
+                <b>Name:</b> '.$agent{'name'}.'<br />
+                <b>Status:</b> '.$atitle.'<br />
+                <b>IP:</b> '.$agent{'ip'}.'<br />
+                <b>Last keep alive:</b> '.
+                date('Y M d H:i:s', $agent{'change_time'}).'<br />
+                <b>OS:</b> '.$agent{'os'}.'<br />
+                <b>OSSEC Version:</b> 1.2<br />
+                ';
+                echo "\n";
+        }
 }
-echo ' 
-<b>Name:</b> '.$agent{'name'}.'<br />
-<b>IP:</b> '.$agent{'ip'}.'<br />
-<b>Last keep alive:</b> '.
-date('Y M d H:i:s', $agent{'change_time'}).'<br />
-<b>OS:</b> '.$agent{'os'}.'<br />
-<b>OSSEC Version:</b> 1.2<br />
-';
-echo "\n";
 ?>
 </div>
 <!-- END HOST INFO -->


OSSEC home | Main Index | Thread Index


OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.