Когда я устанавливаю правило для отправки электронной почты с помощью fiware-perseo cep при изменении атрибута, я не получаю электронное письмо, и если я ищу правило в Mongo, я не вижу его, но если я выполнюполучить правила из API get, я вижу правило.Я использую docker и не знаю, правильно ли я настроил файл .yml для настройки perseo-core, perseo-fe и orion. Я следовал инструкциям:
https://perseo.readthedocs.io/en/latest/admin/
Я не знаю, нужно ли мне в Орионе что-то настраивать, чтобы указывать на Персео.Я предоставляю код в разделе кода.
Часть из кода .yml, я создал это правило с помощью API:
{
"name": "prueba1",
"text": "select *, \"prueba1\" as ruleName ,ev.temperature? as temperature, ev.id? as id from pattern [every ev=iotEvent(cast(cast(temperature?,String),float)>45.5 and type=\"AirQualityObserved\")]",
"action": {
"type": "email",
"template": "Entity ${id} temperature is ${temperature}",
"parameters": {
"to": "antonio.moreno@someplace.com",
"from": "avisos@someplace.com",
"subject": "High Temp"
}
}
}
version: "3.1"
services:
mongo-db:
image: mongo:3.2
hostname: mongo-db
container_name: fiware-mongo-db
ports:
- "27017:27017"
expose:
- "27017"
networks:
- smartcity
volumes:
- "mongo-db:/data"
mysql-db:
image: mysql:5.7
hostname: mysql-db
container_name: fiware-mysql-db
expose:
- "3306"
ports:
- "3306:3306"
networks:
- smartcity
environment:
- "MYSQL_ROOT_PASSWORD=1234"
- "MYSQL_ROOT_HOST=%"
volumes:
- mysql-db:/var/lib/mysql"
orion:
image: fiware/orion:latest
hostname: orion
container_name: fiware-orion-mongo
networks:
- smartcity
expose:
- "1026"
ports:
- "1026:1026"
command: -dbhost mongo-db -logLevel DEBUG
healthcheck:
test: curl --fail -s http://localhost:1026/version || exit 1
cygnus:
image: fiware/cygnus-ngsi:1.10.0
hostname: cygnus
container_name: fiware-cygnus
depends_on:
- mysql-db
- mongo-db
networks:
- smartcity
expose:
- "5080"
ports:
- "5050:5050"
- "5051:5051"
- "5054:5054"
- "5080:5080"
environment:
- "CYGNUS_MULTIAGENT=true" # Whether to persist data into multiple databases.
- "CYGNUS_MONGO_HOSTS=mongo-db:27017" # Comma separated list of Mongo-DB servers which Cygnus will contact to persist historical context data
- "CYGNUS_MONGO_DATA_MODEL=dm-by-service-path" # data_model
- "CYGNUS_MONGO_ATTR_PERSISTENCE=column" # data_model
- "CYGNUS_MONGO_DB_PREFIX=sti-"
- "CYGNUS_MONGO_USER=root"
- "CYGNUS_MONGO_PASS=example"
- "CYGNUS_STH_DB_PREFIX=sth-"
- "CYGNUS_LOG_LEVEL=DEBUG" # The logging level for Cygnus
- "CYGNUS_SERVICE_PORT=5050" # Notification Port that Cygnus listens when subcribing to context data changes
- "CYGNUS_API_PORT=5080" # Port that Cygnus listens on for operational reasons
- "CYGNUS_MYSQL_HOST=mysql-db" # Hostname of the MySQL server used to persist historical context data
- "CYGNUS_MYSQL_PORT=3306" # Port that the MySQL server uses to listen to commands
- "CYGNUS_MYSQL_USER=root" # Username for the MySQL database user
- "CYGNUS_MYSQL_PASS=1234" # Password for the MySQL database user
- "CYGNUS_MYSQL_DATA_MODEL=dm-by-service-path" # data_model
- "CYGNUS_MYSQL_ATTR_PERSISTENCE=row"
healthcheck:
test: curl --fail -s http://localhost:5080/v1/version || exit 1
iot-agent:
image: fiware/iotagent-ul:1.8.0
hostname: iot-agent
container_name: fiware-iot-agent
networks:
- smartcity
ports:
- "4041:4041"
- "7896:7896"
environment:
- "IOTA_CB_HOST=orion" # name of the context broker to update context
- "IOTA_CB_PORT=1026" # port the context broker listens on to update context
- "IOTA_NORTH_PORT=4041"
- "IOTA_REGISTRY_TYPE=mongodb" #Whether to hold IoT device info in memory or in a database
- "IOTA_LOG_LEVEL=DEBUG" #The log level of the IoT Agent
- "IOTA_TIMESTAMP=true"
- "IOTA_MONGO_HOST=mongo-db" # The host name of ongoDB
- "IOTA_MONGO_PORT=27017" # The port mongoDB is listening on
- "IOTA_MONGO_DB=iot-smartcity" # The name of the database used in mongoDB
- "IOTA_HTTP_PORT=7896" # The port used for device traffic over HTTP
- "IOTA_PROVIDER_URL=http://iot-agent:4041"
healthcheck:
test: curl --fail -s http://localhost:4041/iot/about || exit 1
sth-comet:
image: fiware/sth-comet
hostname: sth-comet
container_name: fiware-sth-comet
networks:
- smartcity
ports:
- "8666:8666"
environment:
- STH_HOST=0.0.0.0
- STH_PORT=8666
- DB_PREFIX=sth-commet-
- "DB_URI=mongo-db:27017"
- LOGOPS_LEVEL=DEBUG
perseo-core:
image: fiware/perseo-core
hostname: perseo-core
container_name: fiware-perseo-core
depends_on:
- mongo-db
- orion
networks:
- smartcity
ports:
- "8080:8080"
environment:
- PERSEO_FE_URL=http://perseo-fe:9090
- MAX_AGE=6000
perseo-front:
image: fiware/perseo
hostname: perseo-fe
container_name: fiware-perseo-fe
networks:
- smartcity
ports:
- "9090:9090"
depends_on:
- perseo-core
environment:
- PERSEO_ENDPOINT_HOST=perseo-core
- PERSEO_ENDPOINT_PORT=8080
- PERSEO_MONGO_HOST=mongo-db
- PERSEO_MONGO_URL=http://mongo-db:27017
- PERSEO_MONGO_ENDPOINT=mongo-db:27017
- PERSEO_ORION_URL=http://orion:1026/
- PERSEO_LOG_LEVEL=debug
- PERSEO_CORE_URL=http://perseo-core:8080
- PERSEO_SMTP_SECURE=true
- PERSEO_MONGO_USER:"root"
- PERSEO_MONGO_PASSWORD:"example"
- PERSEO_SMTP_HOST=mail.someplace.com
- PERSEO_SMTP_PORT=25
- PERSEO_SMTP_AUTH_USER=someplace@someplace.com
- PERSEO_SMTP_AUTH_PASS=xxxxx
- PERSEO_NOTICES_PATH='/notices'
- PERSEO_RULES_PATH='/rules'
networks:
- smartcity
volumes:
mongo-db:
mysql-db:
networks:
smartcity:
driver: bridge
Я хочу иметь возможность отправлять электронную почтукогда атрибут превышает пороговое значение, теперь он не работает.