This repository was archived by the owner on Dec 20, 2018. It is now read-only.
File tree 2 files changed +72
-0
lines changed
2 files changed +72
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/python
2
+ # coding: utf-8
3
+
4
+ from Adafruit_BMP085 import BMP085
5
+ import sys
6
+
7
+ # ===========================================================================
8
+ # Munin Plugin - Pressure
9
+ # ===========================================================================
10
+
11
+ # Initialise the BMP085 and use STANDARD mode (default value)
12
+ # bmp = BMP085(0x77, debug=True)
13
+ bmp = BMP085 (0x77 )
14
+
15
+ # To specify a different operating mode, uncomment one of the following:
16
+ # bmp = BMP085(0x77, 0) # ULTRALOWPOWER Mode
17
+ # bmp = BMP085(0x77, 1) # STANDARD Mode
18
+ # bmp = BMP085(0x77, 2) # HIRES Mode
19
+ # bmp = BMP085(0x77, 3) # ULTRAHIRES Mode
20
+
21
+ temp = bmp .readTemperature ()
22
+
23
+ # Read the current barometric pressure level
24
+ pressure = bmp .readPressure ()
25
+
26
+ is_config = len (sys .argv ) == 2 and sys .argv [1 ] == "config"
27
+
28
+ if is_config :
29
+ print "graph_title Pressure (I2C)"
30
+ print "graph_vlabel mBar"
31
+ print "graph_category sensors"
32
+ print "graph_scale no"
33
+ print "graph_args -A -Y"
34
+ print "pressure.label Pressure (mBar)"
35
+ else :
36
+ print "pressure.value %.4f" % (pressure / 100.0 )
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/python
2
+ # coding: utf-8
3
+
4
+ from Adafruit_BMP085 import BMP085
5
+ import sys
6
+
7
+ # ===========================================================================
8
+ # Munin Plugin - Temperature
9
+ # ===========================================================================
10
+
11
+ # Initialise the BMP085 and use STANDARD mode (default value)
12
+ # bmp = BMP085(0x77, debug=True)
13
+ bmp = BMP085 (0x77 )
14
+
15
+ # To specify a different operating mode, uncomment one of the following:
16
+ # bmp = BMP085(0x77, 0) # ULTRALOWPOWER Mode
17
+ # bmp = BMP085(0x77, 1) # STANDARD Mode
18
+ # bmp = BMP085(0x77, 2) # HIRES Mode
19
+ # bmp = BMP085(0x77, 3) # ULTRAHIRES Mode
20
+
21
+ temp = bmp .readTemperature ()
22
+
23
+ # Read the current barometric pressure level
24
+ pressure = bmp .readPressure ()
25
+
26
+ is_config = len (sys .argv ) == 2 and sys .argv [1 ] == "config"
27
+
28
+ if is_config :
29
+ print "graph_title Temperatur (I2C)"
30
+ print "graph_vlabel °C"
31
+ print "graph_category sensors"
32
+ #print "graph_scale no"
33
+ #print "graph_args -A -Y"
34
+ print "temperature.label Temperatur (°C)"
35
+ else :
36
+ print "temperature.value %.4f" % temp
You can’t perform that action at this time.
0 commit comments