Skip to content

Configuring config.dat

Phil Huhn edited this page Sep 25, 2019 · 2 revisions

Table of Contents

config.dat

config.dat Column Descriptions

Name Sample value Data Type Note
Id Door-115 String Unique value
Sensor Type Door String
Location 115 String campus / building / room
GPIO Pin 4 Integer
Validation Type R String R/A/N (Range/Alway/Never)
Valid Value 0 Integer 0/1 (electrically off or on)
Valid Start Time 08:00:00 String works with 'Range' type
Valid End Time 17:00:00 String works with 'Range' type
Settings open String array "|" Delimiter
Notification 0 Integer 0/1 (0=false / 1=true) (if true use check_state_statusjson.sh custom Nagios check script)

config.dat Example

id,type,room,gpio,valtyp,vadval,start,end,settings,notification
door-115,Door,115,4,R,0,08:00:00,17:00:00,closed|open,0
light-115,Light,115,18,R,0,08:00:00,17:00:00,off|on,0
door-116,Door,116,17,A,0,00:00:00,23:59:59,closed|open,0
refrig-116,Refrig,116,22,N,0,00:00:00,23:59:59,ok|alarm,1

Test config.dat Configuration

Test your configuration by navigating to the folder containing the test copy of py-logger with console logging an execute the following command:

  cd ./py-logger-master/py-logger/.
  sudo python3 py-logger.py

Also verify it is working with Nagios

http://<r-pi ip address>/nagios/
Verify by selecting the Services, Notifications and Event Logs. The Services and Notifications are dynamic and the Event Logs are a static understanding of what happens.