You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

app-watcher

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-watcher

A simple serverless program to watch your application. If your application gets down, module send email notification

1.1.6
latest
Source
npmnpm
Version published
Weekly downloads
3
-82.35%
Maintainers
4
Weekly downloads
 
Created
Source

Node App Watcher

A simple node module which acts as a serverless program to monitor your application status.

**It will send notification, once your application status changes(UP or DOWN)

Installation and setup

Using npm:

$ npm i -g npm
$ npm i --save app-watcher

Init Method:

watcher.start(config<object>);

Config object should contains following properties

  • email: "gmail-id" Email id for sending notification(From mail id)
  • pass: "gmail-password"
  • to: ["email-id", "email-id"] add one or multiple gmail ids for getting notification from watcher
  • appUrl: - Application URL to be monitored
  • emailContent - this is a optional parameter, you can change subject and content of notification email
KeyTypeOptionalDescription
emailStringfalseEmail id for sending notification. Email id should be gmail account id.
passStringfalsePassword of gmail account.
toArray[String] or StringfalseHere you add your notification receivers list
appUrlStringfalseApplication url checking status about application
emailContentObjecttrueThis is a optional parameter. You can change email content.

Email Content

emailContent is a optional parameter, it has two attributes

  • success {subject (String), body (String or HTMLString)}

  • failure {subject (String), body (String or HTMLString)}

keyTypeOptionalDescriptiondefault values
emailContent.success.subjectStringtrueOptional parameter. You can add you success email subjectApp Status - Started
emailContent.success.bodyString or HTML StringtrueOptional parameter. You can add you success email body
Your application started at Mon Mar 01 2018 16:50:02 GMT+0530 (IST)
emailContent.failure.subjectStringtrueOptional parameter. You can add you failure email subjectApp Status - Terminated
emailContent.success.bodyStringtrueOptional parameter. You can add you failure email body
Your application terminated due to [Reason]

Email Notication

We are using node mailer for sending emails. So you can add multible to email ids

Gmail account configuration

Turn on gmail less secure option for sending emails through nodemailer. https://nodemailer.com/usage/using-gmail/

Examples

watcher.js


var watcher = require("app-watcher");

//default method
watcher.start({
    from: "*****@gmail.com",
    pass: "***********",
    to: ["****@gmail.com", "****@hotmail.com", "*****@domain.com"],
    appUrl: "http://application.com/"
});

(or)

watcher.start({
    from: "*****@gmail.com",
    pass: "***********",
    to: ["****@gmail.com", "****@hotmail.com", "*****@domain.com"],
    appUrl: "http://application.com/",


    emailContent: {         //optional parameter
        success: {
            subject: "",
            body: ""
        },
        failure: {
            subject: "",
            body: ""
        }
    }
});
$ node watcher.js;

Support

Keywords

app-watcher

FAQs

Package last updated on 02 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts