diff options
Diffstat (limited to 'plugins-scripts/check_rpc.pl')
| -rwxr-xr-x | plugins-scripts/check_rpc.pl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl index 20c204de..d2701e95 100755 --- a/plugins-scripts/check_rpc.pl +++ b/plugins-scripts/check_rpc.pl | |||
| @@ -15,10 +15,8 @@ | |||
| 15 | # | 15 | # |
| 16 | # initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop | 16 | # initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop |
| 17 | # Modified May 2002 Subhendu Ghosh - support for ePN and patches | 17 | # Modified May 2002 Subhendu Ghosh - support for ePN and patches |
| 18 | # current status: $Revision$ | ||
| 19 | # | 18 | # |
| 20 | # Copyright Notice: GPL | 19 | # Copyright Notice: GPL |
| 21 | # $Id$ | ||
| 22 | # | 20 | # |
| 23 | 21 | ||
| 24 | use strict; | 22 | use strict; |
| @@ -38,13 +36,13 @@ sub print_help (); | |||
| 38 | sub print_usage (); | 36 | sub print_usage (); |
| 39 | sub in ($$); | 37 | sub in ($$); |
| 40 | 38 | ||
| 41 | $ENV{'BASH_ENV'}=''; | 39 | $ENV{'BASH_ENV'}=''; |
| 42 | $ENV{'ENV'}=''; | 40 | $ENV{'ENV'}=''; |
| 43 | $ENV{'PATH'}=''; | 41 | $ENV{'PATH'}=''; |
| 44 | $ENV{'LC_ALL'}='C'; | 42 | $ENV{'LC_ALL'}='C'; |
| 45 | 43 | ||
| 46 | #Initialise protocol for each progname number | 44 | #Initialise protocol for each progname number |
| 47 | # 'u' for UDP, 't' for TCP | 45 | # 'u' for UDP, 't' for TCP |
| 48 | $proto[10003]='u'; | 46 | $proto[10003]='u'; |
| 49 | $proto[10004]='u'; | 47 | $proto[10004]='u'; |
| 50 | $proto[10007]='u'; | 48 | $proto[10007]='u'; |
| @@ -67,9 +65,9 @@ GetOptions( | |||
| 67 | if ($opt_h) { print_help(); exit $ERRORS{'OK'}; } | 65 | if ($opt_h) { print_help(); exit $ERRORS{'OK'}; } |
| 68 | 66 | ||
| 69 | # -V means display version number | 67 | # -V means display version number |
| 70 | if ($opt_V) { | 68 | if ($opt_V) { |
| 71 | print_revision($PROGNAME,'$Revision$ '); | 69 | print_revision($PROGNAME,'@NP_VERSION@'); |
| 72 | exit $ERRORS{'OK'}; | 70 | exit $ERRORS{'OK'}; |
| 73 | } | 71 | } |
| 74 | 72 | ||
| 75 | # Hash containing all RPC program names and numbers | 73 | # Hash containing all RPC program names and numbers |
| @@ -275,7 +273,7 @@ if (defined $opt_c ) { | |||
| 275 | }else{ | 273 | }else{ |
| 276 | print "Version $vers is not an integer\n" if $verbose; | 274 | print "Version $vers is not an integer\n" if $verbose; |
| 277 | } | 275 | } |
| 278 | 276 | ||
| 279 | } | 277 | } |
| 280 | }else{ | 278 | }else{ |
| 281 | get_rpcinfo(); | 279 | get_rpcinfo(); |
| @@ -311,7 +309,7 @@ sub get_rpcinfo { | |||
| 311 | while ( $line = <CMD> ) { | 309 | while ( $line = <CMD> ) { |
| 312 | printf "$line " if $verbose; | 310 | printf "$line " if $verbose; |
| 313 | chomp $line; | 311 | chomp $line; |
| 314 | 312 | ||
| 315 | if ( $line =~ /program $prognum version ([0-9]*) ready and waiting/ ) { | 313 | if ( $line =~ /program $prognum version ([0-9]*) ready and waiting/ ) { |
| 316 | $response .= " version $1"; | 314 | $response .= " version $1"; |
| 317 | $state = 'OK' unless $state ne 'UNKNOWN'; | 315 | $state = 'OK' unless $state ne 'UNKNOWN'; |
| @@ -336,7 +334,7 @@ sub get_rpcinfo { | |||
| 336 | 334 | ||
| 337 | 335 | ||
| 338 | sub print_help() { | 336 | sub print_help() { |
| 339 | print_revision($PROGNAME,'$Revision$ '); | 337 | print_revision($PROGNAME,'@NP_VERSION@'); |
| 340 | print "Copyright (c) 2002 Karl DeBisschop/Truongchinh Nguyen/Subhendu Ghosh\n"; | 338 | print "Copyright (c) 2002 Karl DeBisschop/Truongchinh Nguyen/Subhendu Ghosh\n"; |
| 341 | print "\n"; | 339 | print "\n"; |
| 342 | print "Check if a rpc service is registered and running using\n"; | 340 | print "Check if a rpc service is registered and running using\n"; |
