Template
Posted: Fri 06 Jun 2014, 17:40
This is program template written in Javascript that can be used to send SIA-events from the SPC panel by push mail.
To be able to run the program you need to install NodeJS and some NodeJS addon modules.
Install NodeJS
Check the installation with: node -v
Install required addon modules
Install spc-notify-mail
Modify the settings in config.json according your environment and email account.
In spc-notify-mail.js, function manageSiaEvent() you have to add all SIA-event types you want to be managed by the program. Look in the SPC documentation for definitions of the SIA-event types.
Run the program with: ./spc-notify-mail.js
To be able to run the program you need to install NodeJS and some NodeJS addon modules.
Install NodeJS
Code: Select all
sudo apt-get update
sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
Install required addon modules
Code: Select all
cd <INSTALL_DIR>
sudo npm install websocket
sudo npm install emailjs
Code: Select all
cd <INSTALL_DIR>
tar xzvf spc-notify-mail.tar.gz
cd spc-notify-mail
In spc-notify-mail.js, function manageSiaEvent() you have to add all SIA-event types you want to be managed by the program. Look in the SPC documentation for definitions of the SIA-event types.
Run the program with: ./spc-notify-mail.js