livebox:xap_cacti

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
livebox:xap_cacti [2013/05/27 11:05] – [Creating a GRAPH] brettlivebox:xap_cacti [2013/05/29 01:57] – [Installing Cacti on CentOS] brett
Line 5: Line 5:
 With a xAP caching Lua applet running as a [[hah_plugboard_v2|plugboard]] script on the [[HAH]] and one small python script for CACTI to use this indeed is possible. With a xAP caching Lua applet running as a [[hah_plugboard_v2|plugboard]] script on the [[HAH]] and one small python script for CACTI to use this indeed is possible.
  
-{{:livebox:cacti-graph.png?640}}+{{:livebox:cacti-graph.png}} 
 + 
 +===== Installing Cacti on CentOS ===== 
 + 
 +For CentOS6.x installing is a snap 
 + 
 +If you don't already have the EPEL repository installed into /etc/yum.repos.d/ then do this first. 
 +<code> 
 +rpm -Uvh http://fedora.mirror.uber.com.au/epel/6/i386/epel-release-6-8.noarch.rpm 
 +</code> 
 +Check how to install for older release and Fedora @ http://fedoraproject.org/wiki/EPEL 
 + 
 +Then install cacti 
 +<code> 
 +yum install cacti 
 +</code> 
  
 ===== Setting up the xAP data cache ===== ===== Setting up the xAP data cache =====
Line 17: Line 33:
 local vfs = { local vfs = {
    filter={    filter={
-      xap.Filter{["xap-header"] = { source="dbzoo.livebox.CurrentCost:ch.1" } }, +      xap.Filter{["xap-header"] = { 
-      xap.Filter{["xap-header"] = { source="dbzoo.livebox.CurrentCost:temp" } }, +                    source="dbzoo.livebox.Controller:1wire.*", class="xAPBSC.event" } 
-      xap.Filter{["xap-header"] = { source="dbzoo.livebox.Controller:1wire.*" } },+              }, 
 +      xap.Filter{["xap-header"] = { 
 +                    source="dbzoo.nanode.>", class="xAPBSC.event" } 
 +              }, 
 +      xap.Filter{["xap-header"] = { 
 +                    source="dbzoo.livebox.jeenode:>", class="xAPBSC.event" } 
 +              },
    },    },
    data={}    data={}
 } }
 </code> </code>
 +Read more about the [[hah_plugboard_v2#filter]] class and pattern matching.
  
 After restarting the [[hah_plugboard_v2|plugboad]] engine we can point our web browser at <code>http://<HAH-IP>:8080/</code> and see the xAP frames being cached. After restarting the [[hah_plugboard_v2|plugboad]] engine we can point our web browser at <code>http://<HAH-IP>:8080/</code> and see the xAP frames being cached.
Line 29: Line 52:
 Once some xAP messages have been cached you should see a web page like this: Once some xAP messages have been cached you should see a web page like this:
  
-<note>NOTE: The URLs listed here are not valid hyperlinks.+<code> 
 +Cached xap-header source keys
  
-<html><h2>Cached xap-header source keys</h2><ul> +    dbzoo.livebox.jeenode:outside.lobat 
-<li><a href="#">dbzoo.livebox.CurrentCost:ch.1</a></li> +    dbzoo.nanode.jeenode:3.temp 
-<li><a href="#">dbzoo.livebox.CurrentCost:temp</a></li> +    dbzoo.nanode.jeenode:4.temp 
-<li><a href="#">dbzoo.livebox.Controller:1wire.2</a></li> +    dbzoo.nanode.jeenode:3.lobat 
-<li><a href="#">dbzoo.livebox.Controller:1wire.1</a></li> +    dbzoo.livebox.jeenode:outside.temp2 
-</ul></html></note>+    dbzoo.nanode.jeenode:7.temp 
 +    dbzoo.nanode.jeenode:4.lobat 
 +    dbzoo.livebox.Controller:1wire.
 +    dbzoo.livebox.jeenode:store.light 
 +    dbzoo.nanode.jeenode:2.light 
 +    dbzoo.livebox.jeenode:outside.light 
 +    dbzoo.nanode.jeenode:3.light 
 +    dbzoo.livebox.jeenode:store.temp 
 +    dbzoo.nanode.jeenode:4.light 
 +    dbzoo.nanode.jeenode:2.temp 
 +    dbzoo.nanode.jeenode:7.humi 
 +    dbzoo.nanode.jeenode:7.lobat 
 +    dbzoo.nanode.jeenode:2.lobat 
 +</code>
 ===== Configuring CACTI ===== ===== Configuring CACTI =====
  
Line 43: Line 80:
 You need to include one custom script that will called by the cacti data poller to reach our to our LUA caching web applet to grab xAP data values. You need to include one custom script that will called by the cacti data poller to reach our to our LUA caching web applet to grab xAP data values.
  
-On my system this script appear on a linux server at: ''/var/www/cacti/scripts/xapquery.py'' don't forget to set the permission bits+On my system this script appear on a linux server at: ''/usr/share/cacti/scripts/xapquery.py'' don't forget to set the permission bits
  
 <code> <code>
Line 78: Line 115:
  
 # Useful for debugging # Useful for debugging
-#f = open("/var/www/cacti/log/xapquery.log","a")+#f = open("/var/log/cacti/xapquery.log","a")
 #f.write("%s: %s %s\n" % (time.ctime(), sys.argv, out)) #f.write("%s: %s %s\n" % (time.ctime(), sys.argv, out))
 #f.close() #f.close()
Line 153: Line 190:
 {{cacti-s13.png}} {{cacti-s13.png}}
  
-== Putting it on the Graph Console Tab ==+==== Putting it on the Graph Console Tab ====
  
 {{:livebox:cacti-s14.jpg|}} {{:livebox:cacti-s14.jpg|}}
Line 162: Line 199:
  
 That's all there is to it! That's all there is to it!
 +
 +===== Polling faster =====
 +
 +I like to poll every minute instead of the default 5 mins.
 +
 +{{:livebox:cacti-s20.jpg|}}
 +
 +Then make an adjustment to your cron file to fire the poller every minute.
 +<code>
 +# cat /etc/cron.d/cacti
 +0-59 * * * *    cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
 +#
 +</code>
  • livebox/xap_cacti.txt
  • Last modified: 2013/05/31 11:57
  • by garrydwilms