{"_id":"super-grass","_rev":"49-8d24b8048863c6cc351664981a26ae7b","name":"super-grass","description":"A node.js monitoring tool supporting apis, redis, mongodb and rabbitmq.","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.1":{"name":"super-grass","version":"0.0.1","description":"Monitoring solution for Apis, RabbitMQ, MongoDb and Redis with notification system","main":"index.js","author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"},"keywords":["Monitoring","Notification"],"readmeFilename":"README.md","dependencies":{"async":"~0.2.7","request":"~2.16.6","amqp":"~0.1.6","nstore":"~0.5.2","alfred":"~0.5.4"},"devDependencies":{"mocha":"~1.9.0","should":"~1.2.2"},"readme":"#super-grass\n===========\n\nA monitoring solution for Apis, RabbitMQ, MongoDb and Redis\n\n\n## TODO\n===========\n* Support for RabbitMQ, MongoDb and Redis\n\n* Administration tool which lists the running processes for each supported type\n\n\n\n\n## api\n===========\n\nThe below demonstrates monitoring a website; we simply create a new ```Api``` passing an ```options``` object.\n\nThis options contains 3 values:\n\n* ```retries``` - number of retries before firing the ```snitch``` event\n* ```timeout``` - a timeout value between retries\n* ```minutes_between_notification``` - a value; which can be used to avoid repeatedly firing the same event; by delaying notification\n\nWe can monitor a website with the following line of code:\n\n```\nthis.api.monitor(\"http://www.airasoul.net\");\n```\nWe can also monitor multiple websites by simply calling monitor multiple times like so:\n\n```\nthis.api.monitor(\"http://www.airasoul.net\");\nthis.api.monitor(\"http://blog.airasoul.net\");\n```\n\nThe ```snitch``` event is fired due to a site not responding based on the above options.\nAt this point you can send a notification (sms or email etc) or log an entry in a database or logger. \n\n```\nthis.api.on('snitch', function(url) {\n  //notify\n}\n```\n\nThe following is a complete example:\n\n```\nvar Api = require(\"super-grass\").api;\n\nvar App = function() {\n  var options = {\n    retries:3,\n    timeout:10,\n    minutes_between_notification:30\n  }\n\n  this.api = new Api(options);\n};\n\nApp.prototype.start = function() {\n  this.api.monitor(\"http://www.airasoul.net\");\n\n  this.api.on('snitch', function(url) {\n    var notification = \"The following resource is not responding \"  + url ;\n    console.log(notification);\n  });\n};\n\nmodule.exports = App;\n\nvar app = new App();\napp.start();\n```\n\n## rabbitmq\n===========\n\nThe below demonstrates monitoring a rabbitmq instance; we simply create a new ```Rabbit``` passing an ```options``` object.\n\nThis options contains 3 values:\n\n* ```retries``` - number of retries before firing the ```snitch``` event\n* ```timeout``` - a timeout value between retries\n* ```minutes_between_notification``` - a value; which can be used to avoid repeatedly firing the same event; by delaying notification\n\nWe can monitor a website with the following line of code:\n\n```\nvar options = { \n    host: 'localhost'\n    , port: 5672\n    , login: 'guest'\n    , password: 'guest'\n    , vhost: '/'\n  };\n  \n  this.rabbit.monitor(options);\n  \n```\n\nThe ```snitch``` event is fired due to a site not responding based on the above options.\nAt this point you can send a notification (sms or email etc) or log an entry in a database or logger. \n\n```\nthis.rabbit.on('snitch', function(host\t) {\n  //notify\n}\n```\n\nThe following is a complete example:\n\n```\nvar Rabbit = require(\"super-grass\").rabbit;\n\nvar App = function() {\n  var options = {\n    retries:3,\n    timeout:1000,\n    minutes_between_notification:1\n  }\n\n  this.rabbit = new Rabbit(options);\n};\n\nApp.prototype.start = function() {\n  var options = { \n    host: 'localhost'\n    , port: 5672\n    , login: 'guest'\n    , password: 'guest'\n    , vhost: '/'\n  };\n  \n  this.rabbit.monitor(options);\n\n  this.rabbit.on('snitch', function(host) {\n    var notification = \"The following rabbit is not responding \"  + host ;\n    console.log(notification);\n  });\n};\n\nmodule.exports = App;\n\nvar app = new App();\napp.start();\n```","_id":"super-grass@0.0.1","dist":{"shasum":"0a087fe7e1f6faf235aa496668022c37ec91aaa3","tarball":"https://registry.npmjs.org/super-grass/-/super-grass-0.0.1.tgz","integrity":"sha512-QfLGOluNJ9Tb55VB5TCggrSla8MaayNVd9OrPZ23UI9N0u9VZeHMKBIeqJMti1Eo/HeNbd/5uBVk6y3YMdk9Xw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJb4xUnQBtR7LvU6MX4iEK8EDGEdcRCqNIWU3jsiIHWAiBAU8/08XfUTNRqGtwmYte6+DOMUWgbt+h84fyTQB8c9w=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"airasoul","email":"andrew.keig@gmail.com"},"maintainers":[{"name":"airasoul","email":"andrew.keig@gmail.com"}],"directories":{},"deprecated":"This is no longer in use or being maintained"},"0.0.2":{"name":"super-grass","version":"0.0.2","description":"A node.js monitoring tool supporting apis and rabbitmq","main":"index.js","author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"},"keywords":["Monitoring","Notification"],"readmeFilename":"README.md","dependencies":{"async":"~0.2.7","request":"~2.16.6","amqp":"~0.1.6","underscore":"~1.4.4"},"devDependencies":{"mocha":"~1.9.0","should":"~1.2.2"},"readme":"#super-grass\n===========\n\nA node.js monitoring tool supporting apis and rabbitmq.\n\nThis tool will allows you to define various resources to be monitored; at a configurable interval.  A report is generated at these intervals and an event is fired; which you can hook into allowing you to analyse and then perform your preferd form of notificaion and/or logging.\n\n\n## TODO\n===========\n* Support MongoDb and Redis, REST POST/PUT/DELETE requests\n* An administration tool which lists the running processes for each supported type\n\n\n\n## options\n===========\n\nIn order to use super-grass; simply create an options object with the following properties.\n\n```\noptions = {\n  settings: {\n    interval: \"5000\",\n    retry: \"3\",\n    retryTimeout: \"1000\"\n  }\n, resources: \n  [{\n    type: \"api\",\n    host: \"http://airasoul.net\",\n    enabled : true\n  },\n  {\n    type: \"api\",\n    host: \"http://blog.airasoul.net\",\n    enabled : true\n  },\n  { host: \"rabbit-server\"\n    , port: 5672\n    , login: \"guest\"\n    , password: \"guest\"\n    , vhost: '/'\n    , enabled : true\n    , type: \"rabbit\"\n  }]\n};\n```\n\nThis options settings contains:\n\n* ```interval``` - the interval between notifications\n* ```retry``` - the number of retries for a resource\n* ```retryTimeout``` - a timeout value between retries\n* ```resources``` - a list of resources to be monitored\n\n \n## supported types\n===========\nWe currently support the ability to monitor:\n\nA get request\n\n```\n{\n\ttype: \"api\",\n    host: \"http://airasoul.net\",\n    enabled : true\n }\n```\n\nA rabbitmq server (send message to queue; and consume it)\n\n\n```\n{ \n    host: \"rabbit-server\"\n    , port: 5672\n    , login: 'guest'\n    , password: 'guest'\n    , vhost: '/'\n}\n```\n  \n## example\n===========\n\nThe code is simple; you create a ```super-grass``` object; start watching and wait for a response; the ```snitch``` event to fire.\n\n```\nvar SuperGrass = require('supergrass')\n    , options = require('./options');\n\nvar superGrass = new SuperGrass(options);\nsuperGrass.watch();\n\nsuperGrass.on('snitch', function(report) {\n  console.log(\"RESULTS\", report);\n});\n```\n\nThe report returned contains an array of activity; each resource is returned with a failure identifier; each line in the report represents a single retry.\n\n```\n {url: http://airasoul.net, fails: 1},\n {url: http://airasoul.net, fails: 1},\n {url: http://airasoul.net, fails: 1},\n {url: http://blog.airasoul.net, fails: 1},\n {url: http://blog.airasoul.net, fails: 1},\n {url: http://blog.airasoul.net, fails: 1},\n {url: http://rabbit-server, fails: 1},\n {url: http://rabbit-server, fails: 1},\n {url: http://rabbit-server, fails: 1}\n\n```\nAt this point you could log this information; send an email or sms; its in your hands.. \n\n","_id":"super-grass@0.0.2","dist":{"shasum":"287d37fd2b6bf59e602b6d134d396d36b2e2c297","tarball":"https://registry.npmjs.org/super-grass/-/super-grass-0.0.2.tgz","integrity":"sha512-BIcfPelUvI1mgXEvYl8p7sM15xgDGHbfyll3GnjIg+H9gTSBw/bGL8+50+LGzNfbQfPNs69B4jTbJQUXwUARXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCE/wj4BbUdtgd8VouYULNGw8yzJLSbA9JIuQq0MPV2igIgWQmlUKtqNs+VhFPyiuL8CWObjx+xF0MpNaA7mOU79dM="}]},"maintainers":[{"name":"airasoul","email":"andrew.keig@gmail.com"}],"directories":{},"deprecated":"This is no longer in use or being maintained"},"0.0.3":{"name":"super-grass","version":"0.0.3","description":"A node.js monitoring tool supporting apis and rabbitmq","main":"index.js","author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"},"keywords":["Monitoring","Notification"],"readmeFilename":"README.md","dependencies":{"async":"~0.2.7","request":"~2.16.6","amqp":"~0.1.6","underscore":"~1.4.4","mongoose":"~3.6.7"},"devDependencies":{"mocha":"~1.9.0","should":"~1.2.2"},"readme":"#super-grass\n===========\n\nA node.js monitoring tool supporting apis, mongodb and rabbitmq.\n\nThis tool allows you to define various resources to be monitored for heatbeats; at a configurable interval.  A report is generated at these intervals and an event is fired; which you can hook into allowing you to analyse and then perform your preferd form of notificaion and/or logging.\n\n\n## TODO\n===========\n\n* Support Redis, REST POST/PUT/DELETE requests\n* An administration tool which lists the running processes for each supported type\n\n\n\n## options\n===========\n\n\nIn order to use super-grass; simply create an options object with the following properties.\n\n```\nmodule.exports = {\n  settings: {\n    interval: \"5000\",\n    retry: \"3\",\n    retryTimeout: \"1000\"\n  }\n, resources: \n  [{\n    name: \"api for airasoul.net\",\n    type: \"api\",\n    host: \"http://airasoul.net\",\n    enabled : true\n  },\n  {\n    name: \"api for 127\",\n    type: \"api\",\n    host: \"http://127.0.0.1:2000\",\n    enabled : true\n  },\n  { \n    name: \"local mongo\",\n    type: \"mongo\",\n    host: \"localhost\",\n    database: \"staging\",\n    port: 27017\n  },\n  {\n    name: \"local rabbitmq\",\n    host: \"localhost\",\n    port: 5672,\n    login: \"guest\",\n    password: \"guest\",\n    vhost: '/',\n    enabled : true,\n    type: \"rabbit\"\n  }]\n}\n\n```\n\nThis options settings contains:\n\n* ```interval``` - the interval between notifications\n* ```retry``` - the number of retries for a resource\n* ```retryTimeout``` - a timeout value between retries\n* ```resources``` - a list of resources to be monitored\n\n \n## supported types\n===========\n\nWe currently support the ability to monitor:\n\nA http get request\n\n```\n{\n\tname: \"api for airasoul.net\",\n  type: \"api\",\n  host: \"http://airasoul.net\",\n  enabled : true\n }\n```\n\nA rabbitmq server (send message to queue; and consume it)\n\n\n```\n{ \n  name: \"local rabbitmq\",\n  host: \"localhost\",\n  port: 5672,\n  login: \"guest\",\n  password: \"guest\",\n  vhost: '/',\n  enabled : true,\n  type: \"rabbit\"\n}\n```\n\nA mongodb database; (opens a connection against the db )\n\n```\n{ \n  name: \"local mongo\",\n  type: \"mongo\",\n  host: \"localhost\",\n  database: \"staging\",\n  port: 27017\n}\n```\n\n  \n## example\n===========\n\nThe code is simple; you create a ```super-grass``` object; start watching and wait for a response; the ```snitch``` event to fire.\n\n```\nvar SuperGrass = require('supergrass')\n    , options = require('./options');\n\nvar superGrass = new SuperGrass(options);\nsuperGrass.watch();\n\nsuperGrass.on('snitch', function(report) {\n  console.log(\"RESULTS\", report);\n});\n```\n\nThe report returned contains an array of activity; each resource is returned with a failure identifier; each line in the report represents a single retry.\n\n```\n{ name: 'api for airasoul.net', fails: 0 },\n{ name: 'api for airasoul.net', fails: 0 },\n{ name: 'api for 127', fails: 1 },\n{ name: 'api for 127', fails: 1 },\n{ name: 'api for 127', fails: 1 },\n{ name: 'local mongo', fails: 0 },\n{ name: 'local mongo', fails: 0 },\n{ name: 'local mongo', fails: 0 },\n{ name: 'local rabbitmq', fails: 0 },\n{ name: 'local rabbitmq', fails: 0 },\n{ name: 'local rabbitmq', fails: 0 } \n\n```\nAt this point you could log this information; send an email or sms; its in your hands.. \n\n","_id":"super-grass@0.0.3","dist":{"shasum":"147e6e9698a2763657257aaddc51933c61b6c1bc","tarball":"https://registry.npmjs.org/super-grass/-/super-grass-0.0.3.tgz","integrity":"sha512-X+eu/kJrHWSDTikvVumkexEew0hDT2wUjOP9upanJh0JImpQyIbfcI7E10zcQEpLnfbLl1MBtUszewBdqEqo8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHtsELcU21Eqf+Z0f0MW97TTl4iJK/m+DmmQslzJUDk4AiEAoDvQ6UnEPn7zAJwvtogx35TjhlXS8HK9oMLseJ/P/1Q="}]},"maintainers":[{"name":"airasoul","email":"andrew.keig@gmail.com"}],"directories":{},"deprecated":"This is no longer in use or being maintained"},"0.0.4":{"name":"super-grass","version":"0.0.4","description":"A node.js monitoring tool supporting apis, redis, mongodb and rabbitmq.","main":"index.js","author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"},"keywords":["Monitoring","Notification"],"readmeFilename":"README.md","dependencies":{"async":"~0.2.7","request":"~2.16.6","amqp":"~0.1.6","underscore":"~1.4.4","mongoose":"~3.6.7","redis":"~0.8.3"},"devDependencies":{"mocha":"~1.9.0","should":"~1.2.2"},"readme":".\n\n\n```\n  ___ _   _ _ __   ___ _ __    __ _ _ __ __ _ ___ ___ \n / __| | | | '_ \\ / _ \\ '__|  / _` | '__/ _` / __/ __|\n \\__ \\ |_| | |_) |  __/ |    | (_| | | | (_| \\__ \\__ \\\n |___/\\__,_| .__/ \\___|_|     \\__, |_|  \\__,_|___/___/\n           | |                 __/ |                  \n           |_|                |___/                   \n\n```\n\nsuper grass is a node.js monitoring tool supporting apis, redis, mongodb and rabbitmq.\n\nThis tool allows you to define various resources to be monitored for a heatbeat; at a configurable interval.  \n\nA report is generated at these intervals and an event is fired; which you can hook into allowing you to \nanalyse and then perform your preferd form of notificaion and/or logging.\n\n\n## options\n\n\nIn order to use super-grass; simply create an options object with the following properties.\n\n```\nmodule.exports = {\n  settings: {\n    interval: \"5000\",\n    retry: \"3\",\n    retryTimeout: \"1000\"\n  }\n, resources: \n  [{\n    name: \"api for airasoul.net\",\n    type: \"api\",\n    host: \"http://airasoul.net\",\n    enabled : true\n  },\n  {\n    name: \"api for 127\",\n    type: \"api\",\n    host: \"http://127.0.0.1:2000\",\n    enabled : true\n  },\n  { \n    name: \"local mongo\",\n    type: \"mongo\",\n    host: \"localhost\",\n    database: \"staging\",\n    port: 27017\n  },\n    {\n    name: \"redis local\",\n    type: \"redis\",\n    host: \"http://127.0.0.1\",\n    port: 6379,\n    enabled : true\n  },\n  {\n    name: \"local rabbitmq\",\n    host: \"localhost\",\n    port: 5672,\n    login: \"guest\",\n    password: \"guest\",\n    vhost: '/',\n    enabled : true,\n    type: \"rabbit\"\n  }]\n}\n\n```\n\nThis options settings contains:\n\n* ```interval``` - the interval between notifications\n* ```retry``` - the number of retries for a resource\n* ```retryTimeout``` - a timeout value between retries\n* ```resources``` - a list of resources to be monitored\n\n \n## supported types\n\nWe currently support the ability to monitor:\n\nA http get request\n\n```\n{\n  name: \"api for airasoul.net\",\n  type: \"api\",\n  host: \"http://airasoul.net\",\n  enabled : true\n }\n```\n\nA rabbitmq server (send message to queue; and consume it)\n\n\n```\n{ \n  name: \"local rabbitmq\",\n  host: \"localhost\",\n  port: 5672,\n  login: \"guest\",\n  password: \"guest\",\n  vhost: '/',\n  enabled : true,\n  type: \"rabbit\"\n}\n```\n\nA mongodb database; (opens a connection)\n\n```\n{ \n  name: \"local mongo\",\n  type: \"mongo\",\n  host: \"localhost\",\n  database: \"staging\",\n  port: 27017\n}\n```\n\nA redis store; (opens a connection)\n\n```\n{\n  name: \"redis local\",\n  type: \"redis\",\n  host: \"http://127.0.0.1\",\n  port: 6379,\n  enabled : true\n}\n```\n\n  \n## example\n\nThe code is simple; you create a ```super-grass``` object; start watching and wait for a response; the ```snitch``` event to fire.\n\n```\nvar SuperGrass = require('supergrass')\n    , options = require('./options');\n\nvar superGrass = new SuperGrass(options);\nsuperGrass.watch();\n\nsuperGrass.on('snitch', function(report) {\n  console.log(\"RESULTS\", report);\n  //mail here\n  //log here\n});\n```\n\nThe report returned contains an array of activity; each resource is returned with a failure identifier; each line in the report represents a single retry.\n\n```\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for 127', failed: true },\n{ name: 'api for 127', failed: true },\n{ name: 'api for 127', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'redis local', failed: false },\n{ name: 'redis local', failed: false },\n{ name: 'redis local', failed: false },\n{ name: 'local rabbitmq', failed: false },\n{ name: 'local rabbitmq', failed: false },\n{ name: 'local rabbitmq', failed: false }\n```\n\nAt this point you could log this information; send an email or sms; its in your hands.. \n\n\n## todo\n\n\n* Support REST POST/PUT/DELETE requests\n* An administration tool which lists the reported activity\n\n\n.","_id":"super-grass@0.0.4","dist":{"shasum":"e0a5f0a4b6030af22da35274b925686e27b2e64e","tarball":"https://registry.npmjs.org/super-grass/-/super-grass-0.0.4.tgz","integrity":"sha512-dmR4lOVhPEqB8Yo/tbkLwE5b5JpYsu58jQMXIuKRYMC+Egi2Q0kFjY52capTDjJcCJIcRLxRjzjpOwO2qglubg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAbhenU/edZSun0TaryByWXJD9HGVoNahBqq885zbaEXAiBLFB4UTFZ6k0qOVDdq1hccVSRP/zy80lqVari0XmORAQ=="}]},"maintainers":[{"name":"airasoul","email":"andrew.keig@gmail.com"}],"directories":{},"deprecated":"This is no longer in use or being maintained"},"0.0.5":{"name":"super-grass","version":"0.0.5","description":"A node.js monitoring tool supporting apis, redis, mongodb and rabbitmq.","main":"index.js","author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"},"keywords":["Monitoring","Notification"],"readmeFilename":"README.md","dependencies":{"async":"~0.2.7","request":"~2.16.6","underscore":"~1.4.4","mongoose":"~3.6.7","redis":"~0.8.3"},"devDependencies":{"mocha":"~1.9.0","should":"~1.2.2"},"readme":".\n\n\n```\n  ___ _   _ _ __   ___ _ __    __ _ _ __ __ _ ___ ___ \n / __| | | | '_ \\ / _ \\ '__|  / _` | '__/ _` / __/ __|\n \\__ \\ |_| | |_) |  __/ |    | (_| | | | (_| \\__ \\__ \\\n |___/\\__,_| .__/ \\___|_|     \\__, |_|  \\__,_|___/___/\n           | |                 __/ |                  \n           |_|                |___/                   \n\n```\n\nsuper grass is a node.js monitoring tool supporting apis, redis, mongodb and rabbitmq.\n\nThis tool allows you to define various resources to be monitored for a heatbeat; at a configurable interval.  \n\nA report is generated at these intervals and an event is fired; which you can hook into allowing you to \nanalyse and then perform your preferd form of notificaion and/or logging.\n\n\n## options\n\n\nIn order to use super-grass; simply create an options object with the following properties.\n\n```\nmodule.exports = {\n  settings: {\n    interval: \"10000\",\n    retry: \"3\",\n    retryTimeout: \"1000\"\n  }\n, resources: \n  [{\n    name: \"api for airasoul.net\",\n    type: \"api\",\n    host: \"http://airasoul.net\",\n    enabled : true\n  },\n  {\n    name: \"api for 127\",\n    type: \"api\",\n    host: \"http://127.0.0.1:2000\",\n    enabled : true\n  },\n  { \n    name: \"local mongo\",\n    type: \"mongo\",\n    host: \"localhost\",\n    database: \"staging\",\n    port: 27017,\n    enabled : true\n  },\n  {\n    name: \"redis local\",\n    type: \"redis\",\n    host: \"http://127.0.0.1\",\n    port: 6379,\n    enabled : true\n  },\n  {\n    name: \"local rabbitmq\",\n    host: \"http://127.0.0.1:15672/api/overview\",\n    username: \"guest\",\n    password: \"guest\",\n    enabled : true,\n    type: \"rabbit\"\n  }]\n}\n\n\n```\n\nThis options settings contains:\n\n* ```interval``` - the interval between notifications\n* ```retry``` - the number of retries for a resource\n* ```retryTimeout``` - a timeout value between retries\n* ```resources``` - a list of resources to be monitored\n\n \n## supported types\n\nWe currently support the ability to monitor:\n\nA http get request\n\n```\n{\n  name: \"api for airasoul.net\",\n  type: \"api\",\n  host: \"http://airasoul.net\",\n  enabled : true\n }\n```\n\nA rabbitmq server \n\n\n```\n{ \n  name: \"local rabbitmq\",\n  host: \"http://127.0.0.1:15672/api/overview\",\n  username: \"guest\",\n  password: \"guest\",\n  enabled : true,\n  type: \"rabbit\"\n}\n```\n\nA mongodb database\n\n```\n{ \n  name: \"local mongo\",\n  type: \"mongo\",\n  host: \"localhost\",\n  database: \"staging\",\n  port: 27017\n}\n```\n\nA redis store\n\n```\n{\n  name: \"redis local\",\n  type: \"redis\",\n  host: \"http://127.0.0.1\",\n  port: 6379,\n  enabled : true\n}\n```\n\n  \n## example\n\nThe code is simple; you create a ```super-grass``` object; start watching and wait for a response; the ```snitch``` event to fire.\n\n```\nvar SuperGrass = require('supergrass')\n    , options = require('./options');\n\nvar superGrass = new SuperGrass(options);\nsuperGrass.watch();\n\nsuperGrass.on('snitch', function(report) {\n  console.log(\"RESULTS\", report);\n  //mail here\n  //log here\n});\n```\n\nThe report returned contains an array of activity; each resource is returned with a failure identifier; each line in the report represents a single retry.\n\n```\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for 127', failed: true },\n{ name: 'api for 127', failed: true },\n{ name: 'api for 127', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'redis local', failed: false },\n{ name: 'redis local', failed: false },\n{ name: 'redis local', failed: false },\n{ name: 'local rabbitmq', failed: false },\n{ name: 'local rabbitmq', failed: false },\n{ name: 'local rabbitmq', failed: false }\n```\n\nAt this point you could log this information; send an email or sms; its in your hands.. \n\n\n## todo\n\n\n* Support REST POST/PUT/DELETE requests\n* An administration tool which lists the reported activity\n\n\n.","_id":"super-grass@0.0.5","dist":{"shasum":"3db2b6a100fba58bf7ea0cec1ea5f3c6706f5dbc","tarball":"https://registry.npmjs.org/super-grass/-/super-grass-0.0.5.tgz","integrity":"sha512-bmyTuBd5v1PJxXzQ1badShV3mvraRPSLL5k+rZgBscgjtjSIQQHAkY70PkjojEoW2hhmxJ1WzJ+jqjxiIO6yhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF4ufDEATNRJrCkrCgH7iOgo/PXp5NVgO0fOgbprPNUrAiEA4PGgg660XmrkMgam8RPpgSOoHrwcNJRr6DLl5En/ZgM="}]},"maintainers":[{"name":"airasoul","email":"andrew.keig@gmail.com"}],"directories":{},"deprecated":"This is no longer in use or being maintained"},"0.0.6":{"name":"super-grass","version":"0.0.6","description":"A node.js monitoring tool supporting apis, redis, mongodb and rabbitmq.","main":"index.js","author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"},"keywords":["Monitoring","Notification"],"readmeFilename":"README.md","dependencies":{"async":"~0.2.7","request":"~2.16.6","underscore":"~1.4.4","mongoose":"~3.6.7","redis":"~0.8.3"},"devDependencies":{"mocha":"~1.9.0","should":"~1.2.2"},"readme":".\n\n\n```\n  ___ _   _ _ __   ___ _ __    __ _ _ __ __ _ ___ ___ \n / __| | | | '_ \\ / _ \\ '__|  / _` | '__/ _` / __/ __|\n \\__ \\ |_| | |_) |  __/ |    | (_| | | | (_| \\__ \\__ \\\n |___/\\__,_| .__/ \\___|_|     \\__, |_|  \\__,_|___/___/\n           | |                 __/ |                  \n           |_|                |___/                   \n\n```\n\nsuper grass is a node.js monitoring tool supporting web apis, redis, mongodb and rabbitmq.\n\nThis tool allows you to define various resources to be monitored for a heatbeat; at a configurable interval.  \n\nA report is generated at these intervals and an event is fired; which you can hook into allowing you to \nanalyse and then perform your preferd form of notificaion and/or logging.\n\n\n## options\n\n\nIn order to use super-grass; simply create an options object with the following properties.\n\n```\nmodule.exports = {\n  settings: {\n    interval: \"10000\",\n    retry: \"3\",\n    retryTimeout: \"500\"\n  }\n, resources: \n  [{\n    name: \"api for airasoul.net\",\n    type: \"api\",\n    host: \"http://airasoul.net\",\n    enabled : true\n  },\n  {\n    name: \"api for blog.airasoul.net\",\n    type: \"api\",\n    host: \"http://blog.airasoul.net\",\n    enabled : true\n  },\n  { \n    name: \"local mongo\",\n    type: \"mongo\",\n    host: \"localhost\",\n    database: \"staging\",\n    port: 27017,\n    enabled : true\n  },\n  {\n    name: \"redis local\",\n    type: \"redis\",\n    host: \"http://127.0.0.1\",\n    port: 6379,\n    enabled : true\n  },\n  {\n    name: \"local rabbitmq\",\n    type: \"rabbit\",\n    host: \"http://127.0.0.1:15672/api/overview\",\n    username: \"guest\",\n    password: \"guest\",\n    enabled : true\n  }]\n}\n\n\n```\n\nThis options settings contains:\n\n* ```interval``` - the interval between notifications\n* ```retry``` - the number of retries for a resource\n* ```retryTimeout``` - a timeout value between retries\n* ```resources``` - a list of resources to be monitored\n\n \n## supported types\n\nWe currently support the ability to monitor:\n\nA http get request\n\n```\n{\n  name: \"api for airasoul.net\",\n  type: \"api\",\n  host: \"http://airasoul.net\",\n  enabled : true\n }\n```\n\nA rabbitmq server \n\n\n```\n{ \n  name: \"local rabbitmq\",\n  host: \"http://127.0.0.1:15672/api/overview\",\n  username: \"guest\",\n  password: \"guest\",\n  enabled : true,\n  type: \"rabbit\"\n}\n```\n\nA mongodb database\n\n```\n{ \n  name: \"local mongo\",\n  type: \"mongo\",\n  host: \"localhost\",\n  database: \"staging\",\n  port: 27017\n}\n```\n\nA redis store\n\n```\n{\n  name: \"redis local\",\n  type: \"redis\",\n  host: \"http://127.0.0.1\",\n  port: 6379,\n  enabled : true\n}\n```\n\n  \n## example\n\nThe code is simple; you create a ```super-grass``` object; start watching and wait for a response; the ```snitch``` event to fire.\n\n```\nvar SuperGrass = require('super-grass')\n    , options = require('./options');\n\nvar superGrass = new SuperGrass(options);\nsuperGrass.watch();\n\nsuperGrass.on('snitch', function(report) {\n  console.log(\"RESULTS\", report);\n  //mail here\n  //log here\n});\n```\n\nThe report returned contains an array of activity; each resource is returned with a failure identifier; each line in the report represents a single retry.\n\n```\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for 127', failed: true },\n{ name: 'api for 127', failed: true },\n{ name: 'api for 127', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'redis local', failed: false },\n{ name: 'redis local', failed: false },\n{ name: 'redis local', failed: false },\n{ name: 'local rabbitmq', failed: false },\n{ name: 'local rabbitmq', failed: false },\n{ name: 'local rabbitmq', failed: false }\n```\n\nAt this point you could log this information; send an email or sms; its in your hands.. \n\n\n## todo\n\n\n* Support REST POST/PUT/DELETE requests\n* An administration tool which lists the reported activity\n\n\n.","_id":"super-grass@0.0.6","dist":{"shasum":"2dfb486d324cf829077ce9cb559a0a5461fea487","tarball":"https://registry.npmjs.org/super-grass/-/super-grass-0.0.6.tgz","integrity":"sha512-uzenXgoyGEut4KJqxeANuU0LaxwTci6exKvUF3FJLmvdAw/8fqvDP4/26zRXvTSOxmEK22Z5Be0IwC0lVplVLA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOekpDiFaH+9v1fk1k+TAy1KTWZEJgIUcwCZbfquVucQIhAIi9XNoHWeOELhDWSG4w7w4QtipsVw1p7h9XOgsSCTMy"}]},"maintainers":[{"name":"airasoul","email":"andrew.keig@gmail.com"}],"directories":{},"deprecated":"This is no longer in use or being maintained"},"0.0.7":{"name":"super-grass","version":"0.0.7","description":"A node.js monitoring tool supporting apis, redis, mongodb and rabbitmq.","main":"index.js","author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"},"keywords":["Monitoring","Notification"],"readmeFilename":"README.md","dependencies":{"async":"~0.2.7","request":"~2.16.6","underscore":"~1.4.4","mongoose":"~3.6.7","redis":"~0.8.3","nodemailer":"~0.4.1","cli-table":"~0.2.0","handlebars":"~1.0.10","express":"~3.2.3","consolidate":"~0.9.1","eventvat":"~0.2.1"},"devDependencies":{"mocha":"~1.9.0","should":"~1.2.2"},"readme":"\n```\n  ___ _   _ _ __   ___ _ __    __ _ _ __ __ _ ___ ___ \n / __| | | | '_ \\ / _ \\ '__|  / _` | '__/ _` / __/ __|\n \\__ \\ |_| | |_) |  __/ |    | (_| | | | (_| \\__ \\__ \\\n |___/\\__,_| .__/ \\___|_|     \\__, |_|  \\__,_|___/___/\n           | |                 __/ |                  \n           |_|                |___/                   \n```\n\nsuper grass is a node.js monitoring tool supporting:\n\n* ```http get```\n* ```http get (basic auth)```\n* ```redis```\n* ```mongodb```\n* ```rabbitmq```\n\nThis tool allows you to define various resources to be monitored for a ```heatbeat```; at a ```configurable interval```.\n\nA ```report``` is generated at these intervals and an event is fired; which you can hook into allowing you to analyse and then perform your preferred form of notification and/or logging.\n\nSuper grass includes with a ```management ui``` which allows you to check the status of your resources.\n\nIt also includes an option to lists the resource status to a table and ```log to console``` and/or ```send in email``` \n\n\n\n\n## example\n\nThe code is simple; you create a ```super-grass``` object; start watching and wait for a response; the ```snitch``` event to fire.\n\n```\nvar SuperGrass = require('super-grass')\n    , options = require('./options');\n\nvar superGrass = new SuperGrass(options);\nsuperGrass.watch();\n\nsuperGrass.on('snitch', function(report) {\n  //mail here\n  //log here\n});\n```\n\nThe report returned contains an array of activity; each resource is returned with a failure identifier; each line in the report represents a single retry.\n\n```\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for airasoul.net', failed: false },\n{ name: 'api for 127', failed: true },\n{ name: 'api for 127', failed: true },\n{ name: 'api for 127', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'local mongo', failed: true },\n{ name: 'redis local', failed: false },\n{ name: 'redis local', failed: false },\n{ name: 'redis local', failed: false },\n{ name: 'local rabbitmq', failed: false },\n{ name: 'local rabbitmq', failed: false },\n{ name: 'local rabbitmq', failed: false }\n```\n\nAt this point you could log this information; send an email or sms; its in your hands..\n\n## options\n\nsuper-grass; requires an options object with the following properties; the resources section contains a list of the resources you would like to monitor.\n\n```\nmodule.exports = {\n  settings: {\n    interval: \"0\",\n    retry: \"3\",\n    retryTimeout: \"0\",\n    email: {\n      login: \"you@somewhere.com\",\n      password: \"password\",\n      to: \"you@somewhere.com\",\n      from : \"you@somewhere.com\",\n      fromName : \"Airasoul\"\n    },\n    server: { port : 3000 }\n  }\n, resources: \n  [{\n    name: \"api for airasoul.net\",\n    type: \"api\",\n    host: \"http://airasoul.net\",\n    enabled : true\n  },\n  {\n    name: \"api for blog.airasoul.net\",\n    type: \"api\",\n    host: \"http://blog.airasoul.net\",\n    enabled : true\n  },\n  { \n    name: \"local mongo\",\n    type: \"mongo\",\n    host: \"localhost\",\n    database: \"staging\",\n    port: 27017,\n    enabled : true\n  },\n  {\n    name: \"redis local\",\n    type: \"redis\",\n    host: \"http://127.0.0.1\",\n    port: 6379,\n    enabled : true\n  },\n  {\n    name: \"local rabbitmq\",\n    type: \"basicauth\", \n    host: \"http://127.0.0.1:15672/api/aliveness-test/%2F\",\n    username: \"guest\",\n    password: \"guest\",\n    enabled : true\n  }]\n}\n```\n\nThe settings section contains:\n\n* ```interval``` - the interval between notifications\n* ```retry``` - the number of retries for a resource\n* ```retryTimeout``` - a timeout value between retries\n* ```email``` - email details for sending an email\n* ```server``` - details for http server\n* ```resources``` - a list of resources to be monitored\n\n\n## print to console\n\n\nSimply call ```superGrass.print(report)```\n\n```\nvar SuperGrass = require('./lib/supergrass')\n, options = require('./options')\n, superGrass = new SuperGrass(options);\n\nsuperGrass.watch();\nsuperGrass.on('snitch', function(report) {\n  superGrass.print(report);\n});\n```\n\n## send email\n\nSimply call ```superGrass.email(report)```\n\n```\nvar SuperGrass = require('./lib/supergrass')\n, options = require('./options')\n, superGrass = new SuperGrass(options);\n\nsuperGrass.watch();\nsuperGrass.on('snitch', function(report) {\n  superGrass.email(report);\n});\n```\n\n## management ui\n\nOur management ui allows us todo two things:\n\n* monitor the status of the resources in configuration.\n* start/stop sending emails\n\t\n\nThe management ui has three endpoints:\n\n* View status - /status\n* Start sending emails - /start\n* Stop sending emails - /stop\n\n\n## todo\n* Support REST POST/PUT/DELETE requests\n\n.","_id":"super-grass@0.0.7","dist":{"shasum":"7c5626aa37806d614ca3a346d40161ecef84059e","tarball":"https://registry.npmjs.org/super-grass/-/super-grass-0.0.7.tgz","integrity":"sha512-RGSfQ2C9HpGGmXO94AGbeKKQY3xkZ8jcfdt3in/n9toNvoP/9cVGezAGj25JCwiJ181NHlyPhMC038P/bYM1fw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRTeRFG3tQk/ZWo4XGX9gynTNkfJ0EqJUyG+S73un84wIgWhalVvc8nmkcz1J9kmFU5dkECUdhd/HUoXN0YHsGYTs="}]},"maintainers":[{"name":"airasoul","email":"andrew.keig@gmail.com"}],"directories":{},"deprecated":"This is no longer in use or being maintained"},"0.0.8":{"name":"super-grass","version":"0.0.8","description":"A node.js monitoring tool supporting apis, redis, mongodb and rabbitmq.","main":"index.js","author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"},"keywords":["Monitoring","Notification"],"readmeFilename":"README.md","dependencies":{"async":"~0.2.7","request":"~2.16.6","underscore":"~1.4.4","mongoose":"~3.6.7","redis":"~0.8.3","nodemailer":"~0.4.1","cli-table":"~0.2.0","handlebars":"~1.0.10","express":"~3.2.3","consolidate":"~0.9.1","eventvat":"~0.2.1"},"devDependencies":{"mocha":"~1.9.0","should":"~1.2.2"},"readme":"\n```\n  ___ _   _ _ __   ___ _ __    __ _ _ __ __ _ ___ ___ \n / __| | | | '_ \\ / _ \\ '__|  / _` | '__/ _` / __/ __|\n \\__ \\ |_| | |_) |  __/ |    | (_| | | | (_| \\__ \\__ \\\n |___/\\__,_| .__/ \\___|_|     \\__, |_|  \\__,_|___/___/\n           | |                 __/ |                  \n           |_|                |___/                   \n```\n\nsuper grass is a node.js monitoring tool supporting:\n\n* ```http get```\n* ```http get (basic auth)```\n* ```redis```\n* ```mongodb```\n* ```rabbitmq```\n\nThis tool allows you to define various resources to be monitored for a ```heatbeat```; at a ```configurable interval```.\n\nA ```report``` is generated at these intervals and an event is fired; which you can hook into allowing you to analyse and then perform your preferred form of notification and/or logging.\n\nSuper grass includes with a ```management ui``` which allows you to check the status of your resources.\n\nIt also includes an option to lists the resource status to a table and ```log to console``` and/or ```send in email``` \n\n\n\n\n## example\n\nThe code is simple; you create a ```super-grass``` object; start watching and wait for a response; the ```snitch``` event to fire.\n\n```\nvar SuperGrass = require('super-grass')\n    , options = require('./options');\n\nvar superGrass = new SuperGrass(options);\nsuperGrass.watch();\n\nsuperGrass.on('snitch', function(report) {\n  //mail here\n  //log here\n});\n```\n\nThe report returned contains an array of activity; each resource is returned with a failure identifier; each line in the report represents a single retry.\n\n```\n{ name: 'api for airasoul.net', status: Ok },\n{ name: 'api for airasoul.net', status: Ok  },\n{ name: 'api for airasoul.net', status: Ok  },\n{ name: 'api for 127', status: Down },\n{ name: 'api for 127', status: Down },\n{ name: 'api for 127', status: Down },\n{ name: 'local mongo', status: Down },\n{ name: 'local mongo', status: Down },\n{ name: 'local mongo', status: Down },\n{ name: 'redis local', status: Ok },\n{ name: 'redis local', status: Ok },\n{ name: 'redis local', status: Ok },\n{ name: 'local rabbitmq', status: Ok },\n{ name: 'local rabbitmq', status: Ok },\n{ name: 'local rabbitmq', status: Ok }\n```\n\nAt this point you could log this information; send an email or sms; its in your hands..\n\n## options\n\nsuper-grass; requires an options object with the following properties; the resources section contains a list of the resources you would like to monitor.\n\n```\nmodule.exports = {\n  settings: {\n    interval: \"0\",\n    retry: \"3\",\n    retryTimeout: \"0\",\n    email: {\n      login: \"you@somewhere.com\",\n      password: \"password\",\n      to: \"you@somewhere.com\",\n      from : \"you@somewhere.com\",\n      fromName : \"Airasoul\"\n    },\n    server: { port : 3000 }\n  }\n, resources: \n  [{\n    name: \"api for airasoul.net\",\n    type: \"api\",\n    host: \"http://airasoul.net\",\n    enabled : true\n  },\n  {\n    name: \"api for blog.airasoul.net\",\n    type: \"api\",\n    host: \"http://blog.airasoul.net\",\n    enabled : true\n  },\n  { \n    name: \"local mongo\",\n    type: \"mongo\",\n    host: \"localhost\",\n    database: \"staging\",\n    port: 27017,\n    enabled : true\n  },\n  {\n    name: \"redis local\",\n    type: \"redis\",\n    host: \"localhost\",\n    port: 6379,\n    enabled : true\n  },\n  {\n    name: \"local rabbitmq\",\n    type: \"basicauth\", \n    host: \"http://127.0.0.1:15672/api/aliveness-test/%2F\",\n    username: \"guest\",\n    password: \"guest\",\n    enabled : true\n  }]\n}\n```\n\nThe settings section contains:\n\n* ```interval``` - the interval between notifications\n* ```retry``` - the number of retries for a resource\n* ```retryTimeout``` - a timeout value between retries\n* ```email``` - email details for sending an email\n* ```server``` - details for http server\n* ```resources``` - a list of resources to be monitored\n\n\n## print to console\n\n\nSimply call ```superGrass.print(report)```\n\n```\nvar SuperGrass = require('./lib/supergrass')\n, options = require('./options')\n, superGrass = new SuperGrass(options);\n\nsuperGrass.watch();\nsuperGrass.on('snitch', function(report) {\n  superGrass.print(report);\n});\n```\n\n## send email\n\nSimply call ```superGrass.email(report)```\n\n```\nvar SuperGrass = require('./lib/supergrass')\n, options = require('./options')\n, superGrass = new SuperGrass(options);\n\nsuperGrass.watch();\nsuperGrass.on('snitch', function(report) {\n  superGrass.email(report);\n});\n```\n\n## management ui\n\nOur management ui allows us todo two things:\n\n* monitor the status of the resources in configuration.\n* start/stop sending emails\n\t\n\nThe management ui has three endpoints:\n\n* View status - /status\n* Start sending emails - /start\n* Stop sending emails - /stop\n\n\n## todo\n* Support REST POST/PUT/DELETE requests\n\n.","_id":"super-grass@0.0.8","dist":{"shasum":"aeef659b3965ddc2e6ef559a1802d30085229ba5","tarball":"https://registry.npmjs.org/super-grass/-/super-grass-0.0.8.tgz","integrity":"sha512-CQEtMRR78De7RZ6Wmo3iCN9lYKtISo+mKJYVYE5gzX/m0kkn4eEK9Alo9LA2z+jaFbKLAeL+4MKyJufV0dgb+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv/2eGFF9qcGbvOrWLpOnNtPAiTWpXsXfn4FgN0uGWIAIgCcQrepiZAd6NWzNPSIOREhtJrbVRqXkfDOKimYiNJZA="}]},"maintainers":[{"name":"airasoul","email":"andrew.keig@gmail.com"}],"directories":{},"deprecated":"This is no longer in use or being maintained"}},"readme":"#super-grass\n===========\n\nA monitoring solution for Apis, RabbitMQ, MongoDb and Redis\n\n\n## TODO\n===========\n* Support for RabbitMQ, MongoDb and Redis\n\n* Administration tool which lists the running processes for each supported type\n\n\n\n\n## api\n===========\n\nThe below demonstrates monitoring a website; we simply create a new ```Api``` passing an ```options``` object.\n\nThis options contains 3 values:\n\n* ```retries``` - number of retries before firing the ```snitch``` event\n* ```timeout``` - a timeout value between retries\n* ```minutes_between_notification``` - a value; which can be used to avoid repeatedly firing the same event; by delaying notification\n\nWe can monitor a website with the following line of code:\n\n```\nthis.api.monitor(\"http://www.airasoul.net\");\n```\nWe can also monitor multiple websites by simply calling monitor multiple times like so:\n\n```\nthis.api.monitor(\"http://www.airasoul.net\");\nthis.api.monitor(\"http://blog.airasoul.net\");\n```\n\nThe ```snitch``` event is fired due to a site not responding based on the above options.\nAt this point you can send a notification (sms or email etc) or log an entry in a database or logger. \n\n```\nthis.api.on('snitch', function(url) {\n  //notify\n}\n```\n\nThe following is a complete example:\n\n```\nvar Api = require(\"super-grass\").api;\n\nvar App = function() {\n  var options = {\n    retries:3,\n    timeout:10,\n    minutes_between_notification:30\n  }\n\n  this.api = new Api(options);\n};\n\nApp.prototype.start = function() {\n  this.api.monitor(\"http://www.airasoul.net\");\n\n  this.api.on('snitch', function(url) {\n    var notification = \"The following resource is not responding \"  + url ;\n    console.log(notification);\n  });\n};\n\nmodule.exports = App;\n\nvar app = new App();\napp.start();\n```\n\n## rabbitmq\n===========\n\nThe below demonstrates monitoring a rabbitmq instance; we simply create a new ```Rabbit``` passing an ```options``` object.\n\nThis options contains 3 values:\n\n* ```retries``` - number of retries before firing the ```snitch``` event\n* ```timeout``` - a timeout value between retries\n* ```minutes_between_notification``` - a value; which can be used to avoid repeatedly firing the same event; by delaying notification\n\nWe can monitor a website with the following line of code:\n\n```\nvar options = { \n    host: 'localhost'\n    , port: 5672\n    , login: 'guest'\n    , password: 'guest'\n    , vhost: '/'\n  };\n  \n  this.rabbit.monitor(options);\n  \n```\n\nThe ```snitch``` event is fired due to a site not responding based on the above options.\nAt this point you can send a notification (sms or email etc) or log an entry in a database or logger. \n\n```\nthis.rabbit.on('snitch', function(host\t) {\n  //notify\n}\n```\n\nThe following is a complete example:\n\n```\nvar Rabbit = require(\"super-grass\").rabbit;\n\nvar App = function() {\n  var options = {\n    retries:3,\n    timeout:1000,\n    minutes_between_notification:1\n  }\n\n  this.rabbit = new Rabbit(options);\n};\n\nApp.prototype.start = function() {\n  var options = { \n    host: 'localhost'\n    , port: 5672\n    , login: 'guest'\n    , password: 'guest'\n    , vhost: '/'\n  };\n  \n  this.rabbit.monitor(options);\n\n  this.rabbit.on('snitch', function(host) {\n    var notification = \"The following rabbit is not responding \"  + host ;\n    console.log(notification);\n  });\n};\n\nmodule.exports = App;\n\nvar app = new App();\napp.start();\n```","maintainers":[{"email":"npm@npmjs.com","name":"npm"},{"email":"andrew.keig@gmail.com","name":"airasoul"}],"time":{"modified":"2022-06-27T02:08:44.010Z","created":"2013-04-15T19:09:10.604Z","0.0.1":"2013-04-15T19:09:15.525Z","0.0.2":"2013-04-21T22:16:45.723Z","0.0.3":"2013-04-22T17:28:46.590Z","0.0.4":"2013-04-22T22:53:40.641Z","0.0.5":"2013-04-23T13:46:37.770Z","0.0.6":"2013-04-23T14:57:56.825Z","0.0.7":"2013-05-09T20:58:25.808Z","0.0.8":"2013-06-03T21:07:49.047Z"},"author":{"name":"Andrew Keig","email":"andrew.keig@gmail.com"},"repository":{"type":"git","url":"https://github.com/AndrewKeig/super-grass.git"}}