[Nagiosplug-help] Problems with check_rpc (nagios-plugins 1.3.1) 1.7

Subhendu Ghosh sghosh at sghosh.org
Fri Aug 8 07:46:40 CEST 2003


What locale setting are your running with?  It looks like rpcinfo has the 
correct output but may have other characters due to locale setting and 
that causes the parser to fail.

-sg

On Fri, 8 Aug 2003 ecejgv at eresmas.com wrote:

> 
> Hi:
> 
> I have executed the command with -v and the answer is:
> 
> [root at futurespace libexec]# ./check_rpc -H localhost -C nfs -p2049 -c2,3 -v
> Checking nfs version 2 proto u
> /usr/sbin/rpcinfo -n 2049 -u localhost 100003 2 2>&1 |
> the program 100003 version 2 is ready and waiting
>  Checking nfs version 3 proto u
> /usr/sbin/rpcinfo -n 2049 -u localhost 100003 3 2>&1 |
> the program 100003 version 3 is ready and waiting
>  UNKNOWN: RPC program nfs  udp is not running
> 
> I have also executed a debuger in perl (perl -d check_rpc -H localhost -C nfs -p2049 -c2,3. I enclose it in the
> file.
> 
>   The best regards and thanks in advance, Javier.
> 
>  
> 
> 
>  
> 
> 
> 
> ----- Mensaje Original -----
> Remitente: Subhendu Ghosh sghosh at sghosh.org
> Destinatario: ecejgv at eresmas.com
> Fecha: Viernes, Agosto 8, 2003 5:03am
> Asunto: Re: [Nagiosplug-help] Problems with check_rpc (nagios-plugins 1.3.1) 1.7
> 
> >
> >Can you run the program with the verbose option (-v)
> >
> >My results: (RH 7.2)
> >[sghosh at calcutta plugins-scripts]$  ./check_rpc -H localhost -C
> >nfs -p
> >2049 -c2,3
> >OK: RPC program nfs version 2 version 3 udp running
> >
> >-sg
> >
> >
> >On Thu, 7 Aug 2003 ecejgv at eresmas.com wrote:
> >
> >>
> >> Hi:
> >>
> >> I contact you because I have a problem with the script check_rpc
> >version 1.7 (nagios-plugins 1.3.1).
> >>
> >> I have a machine (futurespace) with Linux RedHat 8.0 and with a
> >NFS server started.
> >>
> >> (RPC program=nfs, port=2049, versions=2,3, protocol=udp).
> >>
> >> I want to check if the NFS server is running. For that I execute
> >a check_rpc -H futurespace -C nfs -p 2049 -c2,3
> >> but the answer is "UNKNOWN: RPC program nfs  udp is not running".
> >>
> >> Really the NFS server is running in my machine but the plugin
> >check_rpc doesn't find
> >>
> >> it. How can I solve this problem???
> >>
> >> Moreover I have tried the NIS server (RPC program = ypserv) but
> >it hasn't worked either. I get the same error
> >> message.
> >>
> >> I enclose a log with these testings.
> >>
> >> The best regards and thanks in advance for your attention, Javier.
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >--
> >
> >
> 
> 
> 
> 

-- 

-------------- next part --------------
[root at futurespace libexec]# ./check_rpc -H localhost -C nfs -p2049 -c2,3 -v
Checking nfs version 2 proto u
/usr/sbin/rpcinfo -n 2049 -u localhost 100003 2 2>&1 |
el programa 100003 version 2 esta listo y a la espera
 Checking nfs version 3 proto u
/usr/sbin/rpcinfo -n 2049 -u localhost 100003 3 2>&1 |
el programa 100003 version 3 esta listo y a la espera
 UNKNOWN: RPC program nfs  udp is not running

[root at futurespace libexec]# rpcinfo -p
   programa vers proto   puerto
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp   1024  status
    100024    1   tcp   1024  status
    391002    2   tcp   1025  sgi_fam
    100011    1   udp    879  rquotad
    100011    2   udp    879  rquotad
    100011    1   tcp    882  rquotad
    100011    2   tcp    882  rquotad
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp   1026  nlockmgr
    100021    3   udp   1026  nlockmgr
    100021    4   udp   1026  nlockmgr
    100005    1   udp   1027  mountd
    100005    1   tcp   1031  mountd
    100005    2   udp   1027  mountd
    100005    2   tcp   1031  mountd
    100005    3   udp   1027  mountd
    100005    3   tcp   1031  mountd
[root at futurespace libexec]#

[root at futurespace libexec]# perl -d check_rpc -H localhost -C nfs -c2,3

Loading DB routines from perl5db.pl version 1.19
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

Constant name 'CTL_TYPE' has unknown problems at /usr/lib/perl5/5.8.0/Getopt/Long.pm line 210
        constant::import('constant','CTL_TYPE',0) called at /usr/lib/perl5/5.8.0/Getopt/Long.pm line 210
        Getopt::Long::BEGIN() called at /usr/lib/perl5/5.8.0/constant.pm line 210
        eval {...} called at /usr/lib/perl5/5.8.0/constant.pm line 210
        require Getopt/Long.pm called at check_rpc line 51
        main::BEGIN() called at /usr/lib/perl5/5.8.0/constant.pm line 210
        eval {...} called at /usr/lib/perl5/5.8.0/constant.pm line 210
main::(check_rpc:28):   my ($verbose, at proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state);
  DB<1> n
main::(check_rpc:29):   my ($array_ref,$test,$element, at progkeys,$proto,$a,$b);
  DB<1> n
main::(check_rpc:30):   my ($opt_V,$opt_h,$opt_C,$opt_p,$opt_H,$opt_c,$opt_u,$opt_t);
  DB<1> n
main::(check_rpc:31):   my ($line, @progvers, $response2,$response3);
  DB<1> n
main::(check_rpc:32):   $opt_V = $opt_h = $opt_C = $opt_p = $opt_H =  $opt_u = $opt_t ='';
  DB<1> n
main::(check_rpc:33):   $state = 'UNKNOWN';
  DB<1> n
main::(check_rpc:34):   $progver = $response=$response2= $response3 ='';
  DB<1> n
main::(check_rpc:36):   $PROGNAME = "check_rpc";
main::(check_rpc:37):   sub print_help ();
main::(check_rpc:38):   sub print_usage ();
main::(check_rpc:39):   sub in ($$);
  DB<1> n
main::(check_rpc:41):   $ENV{'BASH_ENV'}='';
  DB<1> n
main::(check_rpc:42):   $ENV{'ENV'}='';
  DB<1> n
main::(check_rpc:43):   $ENV{'PATH'}='';
  DB<1> n
main::(check_rpc:47):   $proto[10003]='u';
  DB<1> n
main::(check_rpc:48):   $proto[10004]='u';
  DB<1> n
main::(check_rpc:49):   $proto[10007]='u';
  DB<1> n
main::(check_rpc:52):   Getopt::Long::Configure('bundling');
  DB<1> n
main::(check_rpc:53):   GetOptions(
main::(check_rpc:54):           "V"   => \$opt_V,   "version"    => \$opt_V,
main::(check_rpc:55):           "h"   => \$opt_h,   "help"       => \$opt_h,
main::(check_rpc:56):           "C=s" => \$opt_C,   "command=s"  => \$opt_C,
main::(check_rpc:57):           "p=i" => \$opt_p,   "port=i"     => \$opt_p,
main::(check_rpc:58):           "H=s" => \$opt_H,   "hostname=s" => \$opt_H,
main::(check_rpc:59):           "c=s" => \$opt_c,   "progver=s"  => \$opt_c,
main::(check_rpc:60):           "v+"  => \$verbose, "verbose+"   => \$verbose,
main::(check_rpc:61):           "u"   => \$opt_u,   "udp"        => \$opt_u,
main::(check_rpc:62):           "t"   => \$opt_t,   "tcp"        => \$opt_t
main::(check_rpc:63):   );
  DB<1> n
main::(check_rpc:66):   if ($opt_h) { print_help(); exit $ERRORS{'OK'}; }
  DB<1> n
main::(check_rpc:69):   if ($opt_V) {
  DB<1> n
main::(check_rpc:78):           "portmapper"  => 100000 ,
main::(check_rpc:79):           "portmap"  => 100000 ,
main::(check_rpc:80):           "sunrpc"  => 100000 ,
main::(check_rpc:81):           "rpcbind"  => 100000 ,
main::(check_rpc:82):           "rstatd"  => 100001 ,
main::(check_rpc:83):           "rstat"  => 100001 ,
main::(check_rpc:84):           "rup"  => 100001 ,
main::(check_rpc:85):           "perfmeter"  => 100001 ,
main::(check_rpc:86):           "rstat_svc"  => 100001 ,
main::(check_rpc:87):           "rusersd"  => 100002 ,
main::(check_rpc:88):           "rusers"  => 100002 ,
main::(check_rpc:89):           "nfs"  => 100003 ,
main::(check_rpc:90):           "nfsprog"  => 100003 ,
main::(check_rpc:91):           "ypserv"  => 100004 ,
main::(check_rpc:92):           "ypprog"  => 100004 ,
main::(check_rpc:93):           "mountd"  => 100005 ,
main::(check_rpc:94):           "mount"  => 100005 ,
main::(check_rpc:95):           "showmount"  => 100005 ,
main::(check_rpc:96):           "ypbind"  => 100007 ,
main::(check_rpc:97):           "walld"  => 100008 ,
main::(check_rpc:98):           "rwall"  => 100008 ,
main::(check_rpc:99):           "shutdown"  => 100008 ,
main::(check_rpc:100):          "yppasswdd"  => 100009 ,
main::(check_rpc:101):          "yppasswd"  => 100009 ,
main::(check_rpc:102):          "etherstatd"  => 100010 ,
main::(check_rpc:103):          "etherstat"  => 100010 ,
main::(check_rpc:104):          "rquotad"  => 100011 ,
main::(check_rpc:105):          "rquotaprog"  => 100011 ,
main::(check_rpc:106):          "quota"  => 100011 ,
main::(check_rpc:107):          "rquota"  => 100011 ,
main::(check_rpc:108):          "sprayd"  => 100012 ,
main::(check_rpc:109):          "spray"  => 100012 ,
main::(check_rpc:110):          "3270_mapper"  => 100013 ,
main::(check_rpc:111):          "rje_mapper"  => 100014 ,
main::(check_rpc:112):          "selection_svc"  => 100015 ,
main::(check_rpc:113):          "selnsvc"  => 100015 ,
main::(check_rpc:114):          "database_svc"  => 100016 ,
main::(check_rpc:115):          "rexd"  => 100017 ,
main::(check_rpc:116):          "rex"  => 100017 ,
main::(check_rpc:117):          "alis"  => 100018 ,
main::(check_rpc:118):          "sched"  => 100019 ,
main::(check_rpc:119):          "llockmgr"  => 100020 ,
main::(check_rpc:120):          "nlockmgr"  => 100021 ,
main::(check_rpc:121):          "x25_inr"  => 100022 ,
main::(check_rpc:122):          "statmon"  => 100023 ,
main::(check_rpc:123):          "status"  => 100024 ,
main::(check_rpc:124):          "bootparam"  => 100026 ,
main::(check_rpc:125):          "ypupdated"  => 100028 ,
main::(check_rpc:126):          "ypupdate"  => 100028 ,
main::(check_rpc:127):          "keyserv"  => 100029 ,
main::(check_rpc:128):          "keyserver"  => 100029 ,
main::(check_rpc:129):          "sunlink_mapper"  => 100033 ,
main::(check_rpc:130):          "tfsd"  => 100037 ,
main::(check_rpc:131):          "nsed"  => 100038 ,
main::(check_rpc:132):          "nsemntd"  => 100039 ,
main::(check_rpc:133):          "showfhd"  => 100043 ,
main::(check_rpc:134):          "showfh"  => 100043 ,
main::(check_rpc:135):          "ioadmd"  => 100055 ,
main::(check_rpc:136):          "rpc.ioadmd"  => 100055 ,
main::(check_rpc:137):          "NETlicense"  => 100062 ,
main::(check_rpc:138):          "sunisamd"  => 100065 ,
main::(check_rpc:139):          "debug_svc"  => 100066 ,
main::(check_rpc:140):          "dbsrv"  => 100066 ,
main::(check_rpc:141):          "ypxfrd"  => 100069 ,
main::(check_rpc:142):          "rpc.ypxfrd"  => 100069 ,
main::(check_rpc:143):          "bugtraqd"  => 100071 ,
main::(check_rpc:144):          "kerbd"  => 100078 ,
main::(check_rpc:145):          "event"  => 100101 ,
main::(check_rpc:146):          "na.event"  => 100101 ,
main::(check_rpc:147):          "logger"  => 100102 ,
main::(check_rpc:148):          "na.logger"  => 100102 ,
main::(check_rpc:149):          "sync"  => 100104 ,
main::(check_rpc:150):          "na.sync"  => 100104 ,
main::(check_rpc:151):          "hostperf"  => 100107 ,
main::(check_rpc:152):          "na.hostperf"  => 100107 ,
main::(check_rpc:153):          "activity"  => 100109 ,
main::(check_rpc:154):          "na.activity"  => 100109 ,
main::(check_rpc:155):          "hostmem"  => 100112 ,
main::(check_rpc:156):          "na.hostmem"  => 100112 ,
main::(check_rpc:157):          "sample"  => 100113 ,
main::(check_rpc:158):          "na.sample"  => 100113 ,
main::(check_rpc:159):          "x25"  => 100114 ,
main::(check_rpc:160):          "na.x25"  => 100114 ,
main::(check_rpc:161):          "ping"  => 100115 ,
main::(check_rpc:162):          "na.ping"  => 100115 ,
main::(check_rpc:163):          "rpcnfs"  => 100116 ,
main::(check_rpc:164):          "na.rpcnfs"  => 100116 ,
main::(check_rpc:165):          "hostif"  => 100117 ,
main::(check_rpc:166):          "na.hostif"  => 100117 ,
main::(check_rpc:167):          "etherif"  => 100118 ,
main::(check_rpc:168):          "na.etherif"  => 100118 ,
main::(check_rpc:169):          "iproutes"  => 100120 ,
main::(check_rpc:170):          "na.iproutes"  => 100120 ,
main::(check_rpc:171):          "layers"  => 100121 ,
main::(check_rpc:172):          "na.layers"  => 100121 ,
main::(check_rpc:173):          "snmp"  => 100122 ,
main::(check_rpc:174):          "na.snmp"  => 100122 ,
main::(check_rpc:175):          "snmp-cmc"  => 100122 ,
main::(check_rpc:176):          "snmp-synoptics"  => 100122 ,
main::(check_rpc:177):          "snmp-unisys"  => 100122 ,
main::(check_rpc:178):          "snmp-utk"  => 100122 ,
main::(check_rpc:179):          "traffic"  => 100123 ,
main::(check_rpc:180):          "na.traffic"  => 100123 ,
main::(check_rpc:181):          "nfs_acl"  => 100227 ,
main::(check_rpc:182):          "sadmind"  => 100232 ,
main::(check_rpc:183):          "nisd"  => 100300 ,
main::(check_rpc:184):          "rpc.nisd"  => 100300 ,
main::(check_rpc:185):          "nispasswd"  => 100303 ,
main::(check_rpc:186):          "rpc.nispasswdd"  => 100303 ,
main::(check_rpc:187):          "ufsd"  => 100233 ,
main::(check_rpc:188):          "ufsd"  => 100233 ,
main::(check_rpc:189):          "pcnfsd"  => 150001 ,
main::(check_rpc:190):          "pcnfs"  => 150001 ,
main::(check_rpc:191):          "amd"  => 300019 ,
main::(check_rpc:192):          "amq"  => 300019 ,
main::(check_rpc:193):          "bwnfsd"  => 545580417 ,
main::(check_rpc:194):          "fypxfrd"  => 600100069 ,
main::(check_rpc:195):          "freebsd-ypxfrd"  => 600100069 ,
main::(check_rpc:196):  );
  DB<1> n
main::(check_rpc:199):  if (defined $verbose && ($verbose > 1) ){
  DB<1> n
main::(check_rpc:213):  unless ($opt_H) { print_usage(); exit $ERRORS{'UNKNOWN'}; }
  DB<1> n
main::(check_rpc:215):  if (! utils::is_hostname($opt_H)){
  DB<1> n
main::(check_rpc:220):          $host = $opt_H;
  DB<1> n
main::(check_rpc:223):  if ($opt_t && $opt_u) {
  DB<1> n
main::(check_rpc:231):  $opt_C = shift unless ($opt_C);
  DB<1> n
main::(check_rpc:232):  unless ($opt_C) { print_usage(); exit -1; }
  DB<1> n
main::(check_rpc:233):  @progkeys = keys %prognum;
  DB<1> n
main::(check_rpc:234):  if ($opt_C =~ m/^([0-9]+)$/){
  DB<1> n
main::(check_rpc:239):      $prognum = $prognum{$opt_C};
  DB<1> n
main::(check_rpc:246):  if($opt_p =~ /^([0-9]+)$/){
  DB<1> n
main::(check_rpc:249):      $port = "";
  DB<1> n
main::(check_rpc:252):  $proto = 'u';
  DB<1> n
main::(check_rpc:253):  $proto = $proto[$prognum] if ($proto[$prognum]);
  DB<1> n
main::(check_rpc:254):  $proto = 't' if ($opt_t);
  DB<1> n
main::(check_rpc:255):  $proto = 'u' if ($opt_u);
  DB<1> n
main::(check_rpc:262):  };
  DB<1> n
main::(check_rpc:263):  alarm($TIMEOUT);
  DB<1> n
main::(check_rpc:266):  if (defined $opt_c ) {
  DB<1> n
main::(check_rpc:267):          my $vers;
  DB<1> n
main::(check_rpc:268):          @progvers = split(/,/ ,$opt_c );
  DB<1> n
main::(check_rpc:269):          foreach $vers (sort @progvers) {
  DB<1> n
main::(check_rpc:270):                  if($vers =~ /^([0-9]+)$/){
  DB<1> n
main::(check_rpc:271):                          $progver = "$1";
  DB<1> n
main::(check_rpc:272):                          print "Checking $opt_C version $progver proto $proto\n" if $verbose;
  DB<1> n
main::(check_rpc:273):                          get_rpcinfo();
  DB<1> n
main::(check_rpc:269):          foreach $vers (sort @progvers) {
  DB<1> n
main::(check_rpc:270):                  if($vers =~ /^([0-9]+)$/){
  DB<1> n
main::(check_rpc:271):                          $progver = "$1";
  DB<1> n
main::(check_rpc:272):                          print "Checking $opt_C version $progver proto $proto\n" if $verbose;
  DB<1> n
main::(check_rpc:273):                          get_rpcinfo();
  DB<1> n
main::(check_rpc:269):          foreach $vers (sort @progvers) {
  DB<1> n
main::(check_rpc:285):  if ($proto eq "u" ){
  DB<1> n
main::(check_rpc:286):          $proto = "udp";
  DB<1> n
main::(check_rpc:291):  if ($state eq 'OK') {
  DB<1> n
main::(check_rpc:294):          if($response){
  DB<1> n
main::(check_rpc:297):                  print "$state: RPC program $opt_C $response2 $proto is not running\n";
  DB<1> n
UNKNOWN: RPC program nfs  udp is not running
main::(check_rpc:300):  exit $ERRORS{$state};
  DB<1> n
Debugged program terminated.  Use q to quit or R to restart,
  use O inhibit_exit to avoid stopping after program termination,
  h q, h R or h O to get additional info.
  DB<1> q
[root at futurespace libexec]#




More information about the Help mailing list