PDA

View Full Version : show graphs with 2 days history


krusty
06-12-2005, 11:32
Hi, does anyone have got an idea how to show graphs with history of 2 days?

In the include file graphs.inc.php i have added the lines:

function navigation_bar($url)
{
$h2=$h2.form_select("period",2*24*3600,"48h");
...
$h2=$h2.form_select("dec",2*24*3600,"-48h");
...
$h2=$h2.form_select("inc",2*24*3600,"+48h");
...
$h2=$h2.form_select("left",2*24,"-48h");
...
$h2=$h2.form_select("right",2*24,"+48h");
...
$a=array(S_1H=>3600,S_2H=>2*3600,S_4H=>4*3600,S_8H=>8*3600,S_12H=>12*3600,
S_24H=>24*3600,S_48H=>48*3600,S_WEEK_SMALL=>7*24*3600,S_MONTH_SMALL=>31*24*3600,S_YEAR_SMALL=>365*24*3600);
...
$a=array("1h"=>1,"2h"=>2,"4h"=>4,"8h"=>8,"12h"=>12,
"24h"=>24,"48h"=>48,"week"=>7*24,"month"=>31*24,"year"=>365*24);
...
}

The values in the graphs are shown rigth. Also the time span but there is no picture shown. Have anyone an idea what i should do???

Please help, it's very important for me. :o

elkor
08-12-2005, 15:17
selecting a 1 day period and then adding 1 day to it from the dropdown boxes should work.

If you are having issues with the dropdowns resetting after you use them once there is a patch for it in the patches section.

krusty
09-12-2005, 09:13
selecting a 1 day period and then adding 1 day to it from the dropdown boxes should work.

If you are having issues with the dropdowns resetting after you use them once there is a patch for it in the patches section.

Hi, i have made the steps like you have created in this link (http://www.zabbix.com/forum/showthread.php?t=1686). I see that the timespan is 2 days and the values are okay too. But i dont see any graph. The discription in the link is from an older version. Isn't it? I have change the variable $_REQUEST["..."] into $_GET["..."] because i use the 1.1beta2 version. But this couldnīt be the error. Have you any idea what i have to do to fix my problem?

cameronsto
09-12-2005, 15:25
Same thing happens for me. Steps to reproduce:

Open graph.
Change period to 24h
Increase +24h
Graph but no plotted line.

-cameron

krusty
09-12-2005, 15:31
Same thing happens for me. Steps to reproduce:

Open graph.
Change period to 24h
Increase +24h
Graph but no plotted line.

-cameron

You are so right. Thatīs the problem iīve had too.

elkor
13-12-2005, 19:34
It works here.

that being said.. I think I may know what the problem is. I have changed my default value to pull from history when the time < 7days (the normal default I believe is 24 hours) once this threshold is crossed, it pulls data from the trends table. What may be occuring is that it is attempting to pull data from trends and it just isn't there (or some other inconsistancy).

to test.. search include/classes.inc.php for "if($this->period<=24*3600)" and increase 24 to a higher number of hours (I used 168) then try again. note: don't make this value more than the amount of history you are retaining for your items.

krusty
14-12-2005, 16:30
to test.. search include/classes.inc.php for "if($this->period<=24*3600)" and increase 24 to a higher number of hours (I used 168) then try again. note: don't make this value more than the amount of history you are retaining for your items.

Hi, i have checked this but all graph shown trash. I think there is no good idea to change parameters like this. I get graphs with 48h range with values on the bottem, but i do not get a graph. I think there is a bug in source code.

elkor
14-12-2005, 20:35
you are right, it's not generally good practice without a user configurable option. I set mine that way locally because I need the higher resolution graphs for several reports.

That being said, I'm still running 1.1b2 locally until I get time to upgrade so it could be a bug in versions greater than that.

krusty
15-12-2005, 08:15
I have checked version 1.1beta3 and 1.1beta4 but this versions have to many bugs. I downgrade to 1.1beta2 and modifid this version.

But when i changed the parameter into include/classes.inc.php for "if($this->period<=24*3600)" and increase 24 to a higher number of hours maybe 48 hours i got no graph. Do you change another parameter?

@developers, could somebody inform us about this bug???

Thanks

elkor
15-12-2005, 14:35
no, that is the only thing I changed in relation to this particular problem.

I did have an issue with missing data for graphs that I described elsewhere on this forum but the graph always displayed.

it's only for 2 day time periods that you get nothing? 1 day works fine as does 1 week, etc?

are there actually values in the database for this?

krusty
16-12-2005, 11:36
I only do not see any graph when select 2 days history. Every other graph is shown. Any idea?

krusty
28-12-2005, 16:42
Hi, could somebody help me with this problem? I want to show one graph with 2day history. When I choose this option in graphs I only get the value but there is no graph. Please help me I need this function. :(

Alexei
29-12-2005, 14:37
Version of ZABBIX?

krusty
01-01-2006, 15:23
Version of ZABBIX?

I check version 1.1beta3 beta4 and beta2. I still run 1.1beta2 because this version is more stable.

krusty
03-01-2006, 15:01
Hi Alexei and the others :D

I have made some screenshot that shows my problem. Today i have updated my zabbix server to 1.1beta5. I donīt get any errors or problems. Nice work. But the problem with the graphs is still in this new version. I do not get any graphs with 2 or more days history. Please show the images.

@all, i wish you a happy new year, and a fantastic zabbix tool. :D

Alexei
03-01-2006, 15:06
Please, give us a screenshot of the item definition.

Also, execute the following SQL statements:

select min(from_unixtime(clock)),max(from_unixtime(clock) ) from history where itemid=17660;
select min(from_unixtime(clock)),max(from_unixtime(clock) ) from trends where itemid=17660;

krusty
03-01-2006, 18:14
Hi Alexei,

here are the two screenshots.

mysql> select min(from_unixtime(clock)),max(from_unixtime(clock) ) from history where itemid=17660;
+---------------------------+----------------------------+
| min(from_unixtime(clock)) | max(from_unixtime(clock) ) |
+---------------------------+----------------------------+
| NULL | NULL |
+---------------------------+----------------------------+
1 row in set (0.00 sec)

mysql>

mysql> select min(from_unixtime(clock)),max(from_unixtime(clock) ) from trends where itemid=17660;
+---------------------------+----------------------------+
| min(from_unixtime(clock)) | max(from_unixtime(clock) ) |
+---------------------------+----------------------------+
| NULL | NULL |
+---------------------------+----------------------------+
1 row in set (0.00 sec)

mysql>

I hope that helps.

krusty
03-01-2006, 18:18
I have search in the zabbix database for 17660 but i can not find any entry with this id. Should i use another entry maybe the graphid or something else for the mysql query?

Alexei
03-01-2006, 21:02
The graph is empty because of missing data in table 'trends'. I have no idea why though.

krusty
04-01-2006, 09:29
Could you shown the graphs about two days history? Why you want to look after the id 17660? I havenīt any id like 17660. I think i should use another id, but i donīt really know which. Can you please tell me what the id 17660 should be?

krusty
04-01-2006, 13:46
Hi Alexei,

know I checked out you debug select min(from_unixtime(clock)),max(from_unixtime(clock) ) from history where itemid=17660; with the itemid from the item LAN - IN and the result is the following. I think this looks very well, because the server has got values.

select min(from_unixtime(clock)),max(from_unixtime(clock) ) from history where itemid=17233;
+---------------------------+----------------------------+
| min(from_unixtime(clock)) | max(from_unixtime(clock) ) |
+---------------------------+----------------------------+
| 2005-10-19 08:12:00 | 2005-12-09 08:23:01 |
+---------------------------+----------------------------+
1 row in set (3.53 sec)


mysql> select min(from_unixtime(clock)),max(from_unixtime(clock) ) from trends where itemid=17233;
+---------------------------+----------------------------+
| min(from_unixtime(clock)) | max(from_unixtime(clock) ) |
+---------------------------+----------------------------+
| 2005-10-19 08:00:00 | 2005-12-09 08:00:00 |
+---------------------------+----------------------------+
1 row in set (0.03 sec)

mysql>

What can i do to isolate the bug. Any idea???

krusty
16-01-2006, 14:50
Alexei, could you please check this!