THOLD Thresholds / Log / Hosts status View

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
blamm09
Posts: 3
Joined: Tue Jul 21, 2015 2:09 am

THOLD Thresholds / Log / Hosts status View

Post by blamm09 »

After upgrade to 0.8.8.d we face a problem in the threshold-views.

For example, if i have 5 pages of "thresholds", stay at page 1 and would like to switch to page 3. If I click on "3" (or any other number on the headline "showing rows x to y [1,2,3,4,5]") the view changes allways to threshold "log"s.
Same thing happenes when I look into "Hosts status".

Any idea how to fix ?

kind regards
B.L.
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: THOLD Thresholds / Log / Hosts status View

Post by cigamit »

I believe that was a bug in 0.8.8d, you should upgrade to 0.8.8f to fix it.
Vadimka
Posts: 3
Joined: Tue Jul 21, 2015 11:35 pm

Re: THOLD Thresholds / Log / Hosts status View

Post by Vadimka »

In the release 0.8.8f the problem persists
My temporary workaround:
I used function get_page_list from release 0.8.8b
blamm09
Posts: 3
Joined: Tue Jul 21, 2015 2:09 am

Re: THOLD Thresholds / Log / Hosts status View

Post by blamm09 »

I just upgraded to 0.8.8f and the problem still exists.

I will have a closer look to the function (nested in lib/html_utility.php) wich Vadimka provided.
Since the functions parameter list differs from 0.8.8b I'm not sure, that a replacement/downgrade of that function works.
blamm09
Posts: 3
Joined: Tue Jul 21, 2015 2:09 am

Re: THOLD Thresholds / Log / Hosts status View

Post by blamm09 »

The problem seems to be a missing & within the url returned from that function.
E.g. Browser shows "...plugins/thold/thold_graph.php?tab=hoststatpage=9" and that leads to show the "logs"-tab instead of page 9 of tab "hoststat".

I've added an & within the else part at document.location='$url&$page_var='+pageNo+url_add :

Code: Select all

        if ($return_to != '') {
                $url_page_select .= "<script type='text/javascript'>function goto${page_var}(pageNo) { if (typeof url_graph === 'function') { var url_add=url_graph('') }else{ var url_add=''; }; $.get('${url}header=false&$page_var='+pageNo+url_add, function(data) { $('#$return_to').html(data);}); }</script>";
        }else{
                $url_page_select .= "<script type='text/javascript'>function goto${page_var}(pageNo) { if (typeof url_graph === 'function') { var url_add=url_graph('') }else{ var url_add=''; }; document.location='$url&$page_var='+pageNo+url_add }</script>";
        }

        return $url_page_select;
This solves the problem from my point of view
Vadimka
Posts: 3
Joined: Tue Jul 21, 2015 11:35 pm

Re: THOLD Thresholds / Log / Hosts status View

Post by Vadimka »

blamm09 wrote:I just upgraded to 0.8.8f and the problem still exists.

I will have a closer look to the function (nested in lib/html_utility.php) wich Vadimka provided.
Since the functions parameter list differs from 0.8.8b I'm not sure, that a replacement/downgrade of that function works.
Not replacement.
I added old function as get_page_list_old and use it in thold files.
jab50
Posts: 13
Joined: Wed Aug 26, 2015 3:46 am

Re: THOLD Thresholds / Log / Hosts status View

Post by jab50 »

Ive been tracking down the same issue (having just updated to 8.8f) but from the mactrack plugin and have came to same conclusion as blamm09. Having found the issue I was then able to search the forum and found this post. As its a utility routine it will equally affect all plugins which use it (the bug is only apparent if the call appends aditional html code to the base url parameter)

I also noticed the cacti base code uses calls to html_nav_bar which wraps the call to get_page_list and does some other stuff (handles Next/Previous tags) which removes the need for the following block of code duplicated in each plugin file. I have modified all my mactrack .php files to use this function instead.

My thold lists never got to longer than 1 page which is probably why I came from mactrack, so I shall look at those files next.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest