File tree Expand file tree Collapse file tree 4 files changed +80
-32
lines changed Expand file tree Collapse file tree 4 files changed +80
-32
lines changed Original file line number Diff line number Diff line change 1
- # Logs
2
- logs
3
- * .log
4
-
5
- # Runtime data
6
- pids
7
- * .pid
8
- * .seed
9
-
10
- # Directory for instrumented libs generated by jscoverage/JSCover
11
- lib-cov
12
-
13
- # Coverage directory used by tools like istanbul
14
- coverage
15
-
16
- # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17
- .grunt
18
-
19
- # node-waf configuration
20
- .lock-wscript
21
-
22
- # Compiled binary addons (http://nodejs.org/api/addons.html)
23
- build /Release
24
-
25
- # Dependency directory
26
- # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27
1
node_modules
Original file line number Diff line number Diff line change 1
- # nagios-check-redis
2
- Simple plugin for nagios to check status of a redis server
1
+ ## nagios-check-redis
2
+
3
+ Simple plugin for nagios to check status of a redis server.
3
4
4
5
## Requirements
5
6
6
- - Node.js >= 0.8. *
7
+ - NodeJS
7
8
- Nagios
8
9
9
10
## Installing
10
11
11
12
To download the latest version:
12
13
13
- npm install nagios-redis
14
+ npm install -g nagios-redis
15
+
16
+ ## Usage
17
+
18
+ nagios-redis -H localhost -p 6379
19
+
20
+ Edit your commands.cfg and add the following:
21
+
22
+ define command {
23
+ command_name check_redis
24
+ command_line $USER1$/nagios-redis/check_redis.js -H $HOSTADDRESS$ -p $ARG1$
25
+ }
26
+
27
+ Now you can monitor redis servers by adding:
14
28
15
- This plugin will output performance data for the property being checked.
29
+ define service {
30
+ use generic-service
31
+ hostgroup_name Redis servers
32
+ service_description Redis server check
33
+ check_command check_redis!6379
34
+ }
16
35
17
36
## License
18
37
19
- yet to be determined
38
+ nope
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+ 'use strict' ;
3
+
4
+ var optimist = require ( 'optimist' )
5
+ . usage ( 'Usage: $0 -H [hostname] -p [port] --help' )
6
+ . default ( 'H' , 'localhost' )
7
+ . default ( 'p' , 6379 )
8
+ . describe ( 'H' , 'hostname of the redis server' )
9
+ . describe ( 'p' , 'port of the redis server' )
10
+ . describe ( 'help' , 'prints this help message' ) ;
11
+ var argv = optimist . argv ;
12
+ var redis = require ( 'redis' ) ;
13
+
14
+ if ( argv . help ) {
15
+ optimist . showHelp ( ) ;
16
+ process . exit ( 0 ) ;
17
+ }
18
+
19
+ var client = redis . createClient ( argv . p , argv . H ) ;
20
+
21
+ client . on ( "error" , function ( err ) {
22
+ console . log ( 'CRITICAL - ' , err . toString ( ) ) ;
23
+ process . exit ( 3 ) ;
24
+ } ) ;
25
+
26
+ client . on ( 'ready' , function ( ) {
27
+ console . log ( 'OK -' , 'uptime_in_days:' , client . server_info . uptime_in_days ) ;
28
+ client . end ( ) ;
29
+ process . exit ( 0 ) ;
30
+ } ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " check_redis" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " Nagios plugin to monitor redis status" ,
5
+ "main" : " check_redis.js" ,
6
+ "bin" : {
7
+ "check_redis" : " ./check_redis.js"
8
+ },
9
+ "keywords" : [
10
+ " nagios" ,
11
+ " redis"
12
+ ],
13
+ "author" : " Michel Hiemstra <info@michelhiemstra.nl>" ,
14
+ "license" : " none" ,
15
+ "dependencies" : {
16
+ "hiredis" : " ^0.3.0" ,
17
+ "optimist" : " ^0.6.1" ,
18
+ "redis" : " ^0.12.1"
19
+ },
20
+ "repository" : {
21
+ "type" : " git" ,
22
+ "url" : " https://github.com/mdahiemstra/nagios-check-redis.git"
23
+ },
24
+ "preferGlobal" : " true"
25
+ }
You can’t perform that action at this time.
0 commit comments