cacti and friends
The last days I spent some time installing digitemp sensors on my watercooling system and setting up cacti to graph the temperatures.
For reading the sensors I use this little python script:
from subprocess import Popen, PIPE, STDOUT
from string import *
from sys import *
process = Popen("digitemp_DS9097 -q -c /etc/digitemp.conf -r2000 -a", shell=True, stdout=PIPE, stderr=STDOUT)
identifiers = argv[1:]
identifiers = map(lambda x: x+":",identifiers)
n = len(identifiers)
values = [.0]*n
valuecount = 0
for line in process.stdout:
line = line.split()
values[valuecount] = line[6]
valuecount += 1
output = ""
for i,j in zip(identifiers,values):
j = str(j)
output += (i+j+" ")
print output
It is called by cacti using
python
The parameters given to the script are simply labels of your choice. Just make shure they fit the number of sensors installed.
Also make sure /etc/digitemp.conf exists and the cacti user (in my case www-data) has access to the serial port that connects the sensors. For me it also has been necessary to change the owner of /var/lockLCK..ttyS0 to www-data, otherwise digitemp was not able to lock the serial port.
This might not be the best sollution but for me it works.
I'm also using lm-sensors by cacti. There for I made another script:
from subprocess import Popen, PIPE, STDOUT
from string import *
from sys import *
process = Popen("sensors", stdout=PIPE, stderr=STDOUT)
identifiers = argv[1:]
identifiers = map(lambda x: x+":",identifiers)
n = len(identifiers)
values = [.0]*n
for line in process.stdout:
line = line.split()
if line != []:
#print line
if line[0] == "VCore":
line = line[1:]
for i in range(n):
if line[0] == identifiers[i]:
values[i] = line[1]
if values[i].endswith("\xc2\xb0C"):
values[i] = values[i][:-3]
if values[i].startswith("+"):
values[i] = values[i][1:]
output = ""
for i,j in zip(identifiers,values):
j = str(j)
output += (i+j+" ")
print output
This is called from cacti by using:
python
For some strange reason not all values read make it into the Round Robin Database, but the script itself seems to work.
Starting from theses scripts it should not be to hard to get the actual graphs. Just follow the guide in the cacti documentation.
Comments
aurora il locksmith
Locksmith Wellington FL
Locksmith Alameda
Milpitas locksmith
Locksmith Milpitas CA
Locksmith Milpitas
Locksmith Milpitas CA
Aventura FL locksmith
irvine locksmith
locksmith miami fl
miami locksmith
locksmith fort worth
miami locksmith
irvine locksmith
irvine locksmith
Hialeah FL Locksmith
Hialeah FL Locksmith
irvine ca locksmith
irvine ca locksmith
Hialeah FL Locksmith
pembroke pines locksmiths
irvine ca locksmith
irvine ca locksmith
Hialeah FL Locksmith
Hialeah FL Locksmith
aventura fl locksmith
locksmith aventura