Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Small Visual Fix for CACTI in "View Cacti Log File"

 
Post new topic   Reply to topic    Cacti Forum Index -> Addons for Cacti
Author Message
_Dmitry_



Joined: 18 Sep 2007
Posts: 26
Location: DE

PostPosted: Fri Nov 16, 2007 4:58 am    Post subject: Small Visual Fix for CACTI in "View Cacti Log File" Reply with quote

Hello,

I've found small Visual BUG in CACTI.
If you go to CACTI Console -> System Utilities -> View Cacti Log File and you have "POLLER: Poller[0] WARNING: Poller Output Table not Empty. Potential Data Source Issues for Data Sources:" with more then 1 DS or Host then only the first one will receive HTTP link direct to Host/Datasolurce. All other DS/Hosts won't be parsed.

With the following fix all DS/Hosts in the Poller Warning receive HTTP link.

Code:

--- utilities.php.old   2007-11-15 13:52:57.000000000 +0100
+++ utilities.php       2007-11-16 10:49:38.579430377 +0100
@@ -775,23 +775,23 @@
                if ((!$host_start) && (!$ds_start)) {
                        $new_item = $item;
                }else{
-                       if ($host_start) {
+                       while ($host_start) {
                                $host_end = strpos($item, "]", $host_start);
                                $host_id = substr($item, $host_start+5, $host_end-($host_start+5));
                                $new_item = $new_item . substr($item, 0, $host_start + 5) . "<a href='host.php?action=edit&id=" . $host_id . "'>" . substr($item, $host_start + 5, $host_end-($host_start + 5)) . "</a>";
                                $item = substr($item, $host_end);
+                               $host_start = strpos($item, "Host[");
                        }
 
                        $ds_start = strpos($item, "DS[");
-                       if ($ds_start) {
+                       while($ds_start) {
                                $ds_end = strpos($item, "]", $ds_start);
                                $ds_id = substr($item, $ds_start+3, $ds_end-($ds_start+3));
                                $new_item = $new_item . substr($item, 0, $ds_start + 3) . "<a href='data_sources.php?action=ds_edit&id=" . $ds_id . "'>" . substr($item, $ds_start + 3, $ds_end-($ds_start + 3)) . "</a>";
                                $item = substr($item, $ds_end);
-                               $new_item = $new_item . $item;
-                       }else{
-                               $new_item = $new_item . $item;
+                               $ds_start = strpos($item, "DS[");
                        }
+                       $new_item = $new_item . $item;
                }
 
                /* determine if we are to display the line */
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9723
Location: MI, USA

PostPosted: Fri Nov 16, 2007 6:41 am    Post subject: Reply with quote

Please log this at http://bugs.cacti.net.

Thanks.

TheWitness
Back to top
_Dmitry_



Joined: 18 Sep 2007
Posts: 26
Location: DE

PostPosted: Fri Nov 16, 2007 7:01 am    Post subject: Reply with quote

Done. http://bugs.cacti.net/view.php?id=1083
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Addons for Cacti All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group