Commit 5843b41f authored by Michael Ott's avatar Michael Ott
Browse files

Merge remote-tracking branch 'micha/master'

parents ecc659a6 acd8311b
......@@ -15,8 +15,7 @@ include $(DCDBCOREPATH)/common.mk
CXXFLAGS = -std=c++11 -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -DBOOST_NETWORK_ENABLE_HTTPS -O2 -g -Wall -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-variable -DBOOST_LOG_DYN_LINK -I$(DCDBBASEPATH)/dcdb/include -I$(DCDBDEPLOYPATH)/include -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final/deps/asio/asio/include
LIBS = -L../deps/mosquitto_build/lib -L$(DCDBDEPLOYPATH)/lib/ -ldl -lmosquitto -lboost_system -lboost_thread -lboost_log_setup -lboost_log -lpthread -lcrypto -lssl -lcppnetlib-server-parsers -lcppnetlib-uri -rdynamic
OBJS = src/dcdbpusher.o src/Configuration.o src/Sensor.o src/MQTTPusher.o src/HttpsServer.o
PLUGINS_BASE = libdcdbplugin_pdu libdcdbplugin_sysfs libdcdbplugin_ipmi libdcdbplugin_bacnet libdcdbplugin_snmp
OBJS = src/dcdbpusher.o src/Configuration.o src/MQTTPusher.o src/HttpsServer.o
PLUGINS = pdu sysfs ipmi bacnet
ifeq ($(OS),Darwin)
......@@ -72,23 +71,27 @@ install: $(TARGET) install_lib install_conf
install $(TARGET) $(DCDBDEPLOYPATH)/bin/
src/Sensor.o: CXXFLAGS+= $(PLUGINFLAGS)
src/SensorGroup.o: CXXFLAGS+= $(PLUGINFLAGS)
src/sensors/%.o: CXXFLAGS+= $(PLUGINFLAGS) -I$(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/include -I$(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/ports/$(BACNET_PORT)
#src/sensors/*/%.o: %.cpp
libdcdbplugin_sysfs.$(LIBEXT): src/Sensor.o src/sensors/sysfs/SysfsSensor.o src/sensors/sysfs/SysfsConfigurator.o
libdcdbplugin_sysfs.$(LIBEXT): src/sensors/sysfs/SysfsSensorGroup.o src/sensors/sysfs/SysfsConfigurator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system
libdcdbplugin_perfevent.$(LIBEXT): src/Sensor.o src/sensors/perfevent/PerfCounter.o src/sensors/perfevent/PerfeventConfigurator.o
libdcdbplugin_perfevent.$(LIBEXT): src/sensors/perfevent/PerfSensorGroup.o src/sensors/perfevent/PerfeventConfigurator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system
libdcdbplugin_ipmi.$(LIBEXT): src/Sensor.o src/sensors/ipmi/IPMISensor.o src/sensors/ipmi/IPMIHost.o src/sensors/ipmi/IPMIConfigurator.o
libdcdbplugin_ipmi.$(LIBEXT): src/sensors/ipmi/IPMISensorGroup.o src/sensors/ipmi/IPMIHost.o src/sensors/ipmi/IPMIConfigurator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lfreeipmi -lboost_regex
libdcdbplugin_pdu.$(LIBEXT): src/Sensor.o src/sensors/pdu/PDUSensor.o src/sensors/pdu/PDUUnit.o src/sensors/pdu/PDUConfigurator.o
libdcdbplugin_pdu.$(LIBEXT): src/sensors/pdu/PDUSensorGroup.o src/sensors/pdu/PDUUnit.o src/sensors/pdu/PDUConfigurator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lcrypto -lssl -lboost_log -lboost_system
libdcdbplugin_bacnet.$(LIBEXT): src/Sensor.o src/sensors/bacnet/BACnetSensor.o src/sensors/bacnet/BACnetClient.o src/sensors/bacnet/BACnetConfigurator.o
libdcdbplugin_bacnet.$(LIBEXT): src/sensors/bacnet/BACnetSensorGroup.o src/sensors/bacnet/BACnetClient.o src/sensors/bacnet/BACnetConfigurator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lbacnet
libdcdbplugin_snmp.$(LIBEXT): src/Sensor.o src/sensors/snmp/SNMPSensor.o src/sensors/snmp/SNMPConnection.o src/sensors/snmp/SNMPConfigurator.o
libdcdbplugin_snmp.$(LIBEXT): src/sensors/snmp/SNMPSensorGroup.o src/sensors/snmp/SNMPConnection.o src/sensors/snmp/SNMPConfigurator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lnetsnmp -lnetsnmpagent
#libdcdbplugin_opa.$(LIBEXT): src/sensors/opa/OpaSensorGroup.o src/sensors/opa/OpaConfigurator.o
# $(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lopamgt -libverbs -libumad -lssl
This diff is collapsed.
......@@ -9,65 +9,41 @@ global {
cacheInterval 90
}
templates {
property def0 {
factor 100
id 85
interval 1000
template_group def0 {
interval 1000
minValues 3
}
}
mqttPart FFFF
devices {
device asdf {
instance 1234
mqttPart FF
object o1 {
type 8
instance 1234
mqttPart FF
property test1 {
factor 10
default def0
mqttsuffix 0000
}
property smth {
id 75
mqttsuffix 0001
}
}
; object o2 {
; type 1
; instance 2
; mqttPart FF
; property propName {
; default def0
; minValues 1
; mqttsuffix 0002
; }
; property propName2 {
; id 80
; minValues 1
; mqttsuffix 0003
; }
; }
property test1 {
factor 10
id 85
deviceInstance 1234
objectInstance 1234
objectType 8
mqttsuffix 0000
}
}
group g1 {
default def0
device jklo {
instance 2222
mqttPart FF
object o {
type 8
instance 1234
mqttPart FF
property prop {
id 75
mqttsuffix 0004
}
}
property smth {
id 80
deviceInstance 1234
objectInstance 1234
objectType 8
mqttsuffix 0001
}
}
group g2 {
mqttPart FFFF
property prop {
deviceInstance 2222
objectInstance 1234
objectType 8
id 75
mqttsuffix 0004
}
}
......@@ -2,14 +2,15 @@ global {
cacheInterval 60
sessiontimeout 500
retransmissiontimeout 200
mqttprefix /AABBAABBAABBAACCDDCCDDCC
mqttprefix ;empty MqttPrefix, because mqttPart of host is used as full prefix
}
templateSensors {
template_group energy {
interval 1000
sensor energy {
; type raw
factor 0.001
interval 1000
cmd "0x00 0x2e 0x81 0x4d 0x4f 0x00 0x00 0x01 0x82 0x00 0x08"
start 5
stop 12
......@@ -17,26 +18,25 @@ templateSensors {
}
}
hosts {
host localhost {
username "USERID"
password "PASSW0RD"
mqttprefix "/00/11/2233445566/778899AABB"
sensors {
sensor energySens {
default energy
MQTTsuffix 11223344
}
sensor recordSens {
recordId 4321
factor 1000
mqttsuffix 11223345
}
host localhost {
username "USERID"
password "PASSW0RD"
mqttPart "/00/11/2233445566/778899AABB"
group g1 {
default energy
}
group g2 {
sensor recordSens {
recordId 4321
factor 1000
mqttsuffix 11223345
}
}
; host test {
; username "USERID"
; password "PASSWORD"
; }
}
;host test {
; username "USERID"
; password "PASSWORD"
;}
global {
mqttPrefix /FF112233445566778899AABBFFFF
}
template_group temp1 {
interval 1000
minValues 3
sensor XmitDat {
cntData portXmitData
mqttsuffix 00
}
}
group XmitDat1 {
default temp1
hfiNum 1
portNum 1
mqttpart 01
}
group XmitDat2 {
default temp1
mqttpart 02
hfiNum 1
portNum 2
}
group p1 {
interval 1000
mqttpart 01
hfiNum 1
portNum 1
sensor rcvDat {
default temp1
mqttsuffix 00
cntData portRcvData
}
sensor rcvPkt {
mqttsuffix 00
cntData portRcvPkts
}
sensor linkDown {
mqttsuffix 00
cntData linkDowned
}
}
......@@ -2,46 +2,47 @@ global {
mqttprefix /00112233445566778899AABBCCDD
}
SensorTemplate {
sensor def1 {
interval 1000
minValues 3
}
template_group def1 {
interval 1000
minValues 3
}
pdus {
pdu rack1 {
host testHorst:443
TTL 500
request "content-length: 167\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?><clustsafeRequest><authorization><username>admin</username><password>admin</password></authorization><energy/></clustsafeRequest>"
pdu rack1 {
host testHorst:443
TTL 500
request "content-length: 167\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?><clustsafeRequest><authorization><username>admin</username><password>admin</password></authorization><energy/></clustsafeRequest>"
sensors {
sensor total {
path "clustsafeResponse.energy.total"
mqttsuffix 0000
}
sensor pcs1 {
path "clustsafeResponse.energy.clustsafe(id=1).outlets.outlet(id=1)"
interval 2000
mqttsuffix 0001
}
sensor pcs2 {
default def1
path "clustsafeResponse.energy.clustsafe(id=2).outlets.outlet(id=3)"
mqttsuffix 0002
}
group pcs {
default def1
mqttpart 00
sensor pcs1 {
path "clustsafeResponse.energy.clustsafe(id=1).outlets.outlet(id=1)"
mqttsuffix 01
}
sensor pcs2 {
path "clustsafeResponse.energy.clustsafe(id=2).outlets.outlet(id=3)"
mqttsuffix 02
}
sensor pcs3 {
default def1
path "clustsafeResponse.energy.clustsafe(id=2).outlets.outlet(id=4)"
mqttsuffix 0003
}
sensor pcs3 {
path "clustsafeResponse.energy.clustsafe(id=2).outlets.outlet(id=4)"
mqttsuffix 03
}
}
pdu rack2 {
; ....
group total {
interval 2000
mqttpart 00
sensor total {
path "clustsafeResponse.energy.total"
mqttsuffix 00
}
}
}
;pdu rack2 {
; ....
;}
CounterTemplate {
counter def1 {
interval 5000
mqttsuffix 0222
minValues 5
type PERF_TYPE_HARDWARE
config PERF_COUNT_HW_INSTRUCTIONS
}
counter def2 {
interval 2000
type PERF_TYPE_HARDWARE
template_group def1 {
interval 5000
mqttpart 02
minValues 5
counter hw_instructions {
type PERF_TYPE_HARDWARE
config PERF_COUNT_HW_INSTRUCTIONS
mqttsuffix 22
}
}
template_group def2 {
interval 2000
cpus 1,2
}
}
counters {
counter hw_instructions {
default def1
mqttsuffix 0020
}
counter hw_branch_instructions {
default def2
mqttsuffix 0024
config PERF_COUNT_HW_BRANCH_INSTRUCTIONS
}
counter hw_branch_misses {
default def2
mqttsuffix 002C
config PERF_COUNT_HW_BRANCH_MISSES
group hw_i {
default def1
mqttpart 23
}
group hw_bi {
default def2
mqttpart 0024
counter hw_branch_instructions {
mqttsuffix
type PERF_TYPE_HARDWARE
config PERF_COUNT_HW_BRANCH_INSTRUCTIONS
}
}
group hw_bm {
default def2
cpus 0,2-3
}
counter sw_pagefaults {
interval 5000
mqttsuffix 0030
type PERF_TYPE_SOFTWARE
config PERF_COUNT_SW_PAGE_FAULTS
}
counter sw_context_switches {
interval 5000
mqttsuffix 0034
type PERF_TYPE_SOFTWARE
config PERF_COUNT_SW_CONTEXT_SWITCHES
}
counter sw_cpu_migrations {
interval 5000
mqttsuffix 0038
type PERF_TYPE_SOFTWARE
config PERF_COUNT_SW_CPU_MIGRATIONS
}
mqttpart 002C
counter hw_branch_misses {
mqttsuffix
type PERF_TYPE_HARDWARE
config PERF_COUNT_HW_BRANCH_MISSES
}
}
group cache {
interval 2000
mqttpart 02
minValues 3
cpus 2-3
counter references {
mqttsuffix 10
type PERF_TYPE_HARDWARE
config PERF_COUNT_HW_CACHE_REFERENCES
}
counter misses {
mqttsuffix 20
type PERF_TYPE_HARDWARE
config PERF_COUNT_HW_CACHE_MISSES
}
}
group sw {
interval 1000
mqttpart 03
minValues 3
cpus 1-4
counter sw_pagefaults {
mqttsuffix 30
type PERF_TYPE_SOFTWARE
config PERF_COUNT_SW_PAGE_FAULTS
}
counter sw_context_switches {
mqttsuffix 34
type PERF_TYPE_SOFTWARE
config PERF_COUNT_SW_CONTEXT_SWITCHES
}
counter sw_cpu_migrations {
mqttsuffix 38
type PERF_TYPE_SOFTWARE
config PERF_COUNT_SW_CPU_MIGRATIONS
}
}
global {
cacheInterval 60
mqttprefix /AABBAABBAABBAACCDDCCDDCC
}
template_group temp1 {
interval 1000
mqttprefix 01
minValues 1
gAtt 0
sensor s1 {
mqttsuffix 01
sAtt 0
}
sensor s2 {
mqttsuffix 02
sAtt 1
}
}
template_entity entity1 {
host localhost
port 1234
group g1 {
default temp1
}
}
group g1 {
default temp1
gAtt 2
mqttprefix 02
}
group g2 {
interval 1000
mqttprefix 10
minValues 1
gAtt 1
sensor se1 {
mqttsuffix 01
sAtt a
}
sensor se2 {
mqttsuffix 02
sAtt b
}
}
entity e1 {
default entity1
group g3 {
default temp1
gAtt 3
mqttpart 02
sensor se3 {
mqttsuffix 3
sAtt c
}
}
}
......@@ -2,57 +2,58 @@ global {
mqttprefix /00112233445566778899AABBCC
}
templates {
sensor temp1 {
interval 1000
minValues 3
}
template_single_sensor temp1 {
interval 1000
minValues 3
}
; Connections contains a list of connections
; So far, we only support "Agent" mode in which we connect to a
; SNMP agent and issue GET commands to read the data.
connections {
; Each connection is identified by a unique name. However, this
; name is only useful when we print error messages.
connection name1 {
Type Agent ; Type of connection
Host HostNameOfSNMPAgent ; Hostname of the SNMP agent
Port 161 ; Port of the SNMP agent
Community public ; SNMP community string
OIDPrefix 1.3.6.1.4.1.1000 ; When querying OIDs, we'll
; always use this prefix
mqttPart BB ; When generating MQTT topics,
; we'll append this part to
; the prefix
sensor name1 {
OID 100.1 ; OID of the sensor
mqttsuffix 0001 ; MQTT suffix of the sensor
interval 1000 ; Read sensor every 1000ms
}
connection name1 {
Type Agent ; Type of connection
Host test.net-snmp.org ; Hostname of the SNMP agent
Port 161 ; Port of the SNMP agent
OIDPrefix 1.3.6.1.2.1.1 ; When querying OIDs, we'll
; always use this prefix
Version 3
Community public ; SNMP community string
Username MD5DESUser
SecLevel AuthPriv
AuthProto MD5
AuthKey "The UCD Demo Password"
PrivProto DES
PrivKey "The UCD Demo Password"
mqttPart BB ; When generating MQTT topics,
; we'll append this part to
; the prefix
sensor name2 {
OID 100.2
mqttsuffix 0002
default temp1
group g1 {
sensor sysUpTime {
OID 3.0 ; OID of the sensor
mqttsuffix 0001 ; MQTT suffix of the sensor
interval 5000 ; Read sensor every 1000ms
}
}
connection name2
{
Type Agent
Host HostNameOfSNMPAgent2
Port 161
Community public
OIDPrefix 1.3.6.1.4.1.1000.15
mqttPart CC
sensor name1 {
OID 3
mqttsuffix 0017
interval 5000
}
single_sensor SysORUpTime {
default temp1
OID 9.1.4.1
mqttsuffix 0002
}
}
;connection name2 {
; Type Agent
; Host HostNameOfSNMPAgent2
; Port 161
; Community public