Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Apr 29, 2017 6:14 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to make custome live graph
PostPosted: Tue Mar 14, 2017 2:30 am 
Offline

Joined: Tue Mar 14, 2017 2:06 am
Posts: 1
Hellow everyone
I new in cacti but I have more information about web programming like as .NET and PHP
Now I like to use some graph from my internet traffic all in one page as a live for each 15sec.

In my page I post the many parameterts to graph_ajax_rt.php in the realtime plugins like as "graph_start=-1800&graph_end=0&local_graph_id=33&ds_step=5&count=35&sync=on"

But mu problem is some times this graphs are work and after some times is not work for example 15Min work fin and after that traffic is not real of complet graphs is not work...!!!

please helmp me to solv this issus.
Thank you

Image

Code:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
var arr = ['36','43','38','40','39','42','32','33','34','35','41','37'];
var img = ['imgmain','img1','img2','img3','img4','img5','img6','img7','img8','img9','img10','img11'];
var iCount = 0;
var timer1 = '';

$(function(){
   process2(36)
})

function process2(id){
$.ajax({url: "plugins/realtime/graph_ajax_rt.php?action=init&graph_start=-1800&graph_end=0&local_graph_id=" + id + "&ds_step=5&count=35&sync=on", success: function(result){
        var prm = result.split("!!!");
      document.getElementById(img[iCount]).src = prm[0];
      iCount++;

      if(iCount < arr.length){
         Thumbnail(arr[iCount]);
      }else{
         iCount = 0;
         clearTimeout(timer1);
         setTimeout('process2(36)',15000);
      }
}});
}

function Thumbnail(id){
   timer1 = setTimeout('process2(' + id + ')',2000);
}

</script>
</head>
<body>
<div id="counter"></div>
<table align="center" cellpadding="1" cellspacing="1">
<tr>
   <td align="center"><img id="imgmain" src=""></td>
</tr>
<tr>
   <td align="center">
      <table>
         <tr>
            <td><img id="img1"    src="" ></td>
            <td><img id="img2" src="" ></td>
            <td><img id="img3" src="" ></td>
            <td><img id="img4" src="" ></td>
         </tr>
         <tr>
            <td><img id="img5" src="" ></td>
            <td><img id="img6"   src="" ></td>
            <td><img id="img7"   src="" ></td>
            <td><img id="img8" src="" ></td>
         </tr>
         <tr>
            <td><img id="img9" src="" ></td>
            <td><img id="img10" src="" ></td>
            <td><img id="img11" src="" ></td>
            <td></td>
         </tr>
      </table>
   </td>
</tr>
</table>
</body>
</html>



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group