Overview
Ce paquet permet d'écrire les compteurs et les alarmes dans Palladium.
Installation
npm install suppervison-palladium
Basic Usage
const Supervision = require('supervision-palladium');
// Declare ELK server
const elkServer = 'http://localhost:9200';
// Declare MongoDB server
const mongoServer = 'mongodb://localhost:27017';
// Create new object
const supv = new Supervision(elkServer, mongoServer);
// Anonymous function, to use the 'await' or you can call the init() function
// at the itialization phase of your application
(async () => {
const cpt205 = {'id': 205, 'eec': 841, 'val': 514, 'date': '2021/10/14 12:03:39'};
await supv.init();
supv.ecrireCompteur(cpt205).then((res: any) => {
console.log('resultat ', res);
});
})();