Page 1 of 1

Returns code of 127 is out of bounds - nagios and esx

Posted: Mon Mar 05, 2012 1:16 pm
by android
Hi,
i am completely new to nagios, for that matter even to linux. so if anyone thinks my questions are completely lame,there is a chance that you are absolutely right :) ,
Ok, to get to the matter. i have installed nagios core 3.0 following the quickstart guide on fedora. works fine ..... i added a windows server in addition to the linux localhost ,works perfect ....now i want to use this to monitor our esx servers, and that is where the problems began (please dont tell me i have to go to esx forum :( )....i am trying to use check_openmanage plugin with SNMP , the host shows up in the nagios web console but the service says " code of 127 is out of bounds, plugin may be missing " .... i did check couple of posts and with reference to that i have few questions ...i dont know if i am in the right track,any help would be appreciated.
so these are my concerns
1) from couple of the online posts asked to crosscheck the path to the plugin , and make sure plugin is there....well all the forums talk about linux and says the default path is /usr/local/nagios/libexec . however i tried installing plugin on two esx servers and the path is /usr/lib64/nagios/plugins/ , i have mentioned this path separately while declaring command in commands.cfg . but dont know if there is another place i need to change it, or should copy the location of the plugins and create a new location as per the default path?? or all that doesnt matter at all ???
2) since i am using snmp , as per couple of forums if snmp was installed after the plugin ( which is true in my case) they asked to recompile the nagios plugin source , and install it....however,nowhere do they talk about packages ( such as rpm, which i used) . since it is esx, i am having difficulty in compiling the source file (no c compiler, gcc,cpp,glibc,glibc-common..........) and trying to install gcc is taking me to whole another nightmare with all its dependancies for installation.....thats y i tried installing with an RPM package.....but from where i am stuck,nobody seems to have came out with an RPM package, ...so any workaround for this????
or could this be any permission issue??? i can run the plugin locally,even using the nagios useraccount....but no heartbeat on the remote nagios server ...
anything else which i should try...
anything else which i might have missed out...

Thanks in advance

Re: Returns code of 127 is out of bounds - nagios and esx

Posted: Mon Mar 05, 2012 2:56 pm
by mguthrie
Lets see if we can get a few things narrowed down.

- Did you use yum to install your nagios package?

- If you install from source, all of you plugins should be in /usr/local/nagios/libexec, and they should all be executable by all users. A packaged installation (rpm or yum) will have a different directory for the plugins, which is fine, you just need to make sure you know where it is.

- Can you show us the command definition you're trying to use, as well as the service definition for this check?

Re: Returns code of 127 is out of bounds - nagios and esx

Posted: Mon Mar 05, 2012 11:53 pm
by android
thanks mguthrie for trying to help, sorry for the late reply...
I downloaded and used .rpm package to install the nagios plugin , maybe thats the reason why the location is different. i do have yum installed with rpmforge repository , however the options are limited for that (esx doesnt have yum and its repositories , right ??? )
i have used the " chown -R user:group /path/of/file " command for the plugins folder, and as said locally i am able to execute the plugin with nagios user. is there any other command i need to try ????

my command definition is "

Code: Select all

 define command {
                   command_name             check_openmanage
                   command_line                /usr/lib64/nagios/plugins/check_openamanage $localhost$
                           }              "

service definition is "
      define service {
                use                       generic-service
                hostgroup_name            esx-servers
                servicegroups             dell-openmanage
                service_description       Dell OMSA
                check_command             check_openmanage
        }

using generic service 
define service{
        name                            generic-service         
        active_checks_enabled           1                      
        passive_checks_enabled          1                     
        parallelize_check               1                      
        obsess_over_service             1                       
        check_freshness                 0                      
        notifications_enabled           1                       
        event_handler_enabled           1                      
        flap_detection_enabled          1                  
        failure_prediction_enabled      1                     
        process_perf_data               1                   
        retain_status_information       1                    
        retain_nonstatus_information    1                       
        is_volatile                     0                      
        check_period                    24x7                  
  max_check_attempts              3                      
        normal_check_interval           10                     
        retry_check_interval            2                      
        contact_groups                  admins                 
        notification_options            w,u,c,r                 
        notification_interval           60                      
        notification_period             24x7                   
         register                        0                      ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
          }
BTW should i be registering these services (changing that bit to one i guess ) seperately while declaring.....
also can firewall be an issue, is there any possibility that snmp is being blocked by firewall???

thanks

Re: Returns code of 127 is out of bounds - nagios and esx

Posted: Tue Mar 06, 2012 5:20 pm
by mguthrie
If this is exactly what you've got defined for the check command, then here's the issue. You have:

define command {
command_name check_openmanage
command_line /usr/lib64/nagios/plugins/check_openamanage $localhost$
}

Should be:

define command {
command_name check_openmanage
command_line /usr/lib64/nagios/plugins/check_openmanage $HOSTADDRESS$
}

I *think* that the default register setting is 1, so usually you only need to add that if it's a template.

Re: Returns code of 127 is out of bounds - nagios and esx

Posted: Wed Mar 07, 2012 8:59 am
by android
Hi,
Finally the issue is resolved, thanks mguthrie for bringing my attention to that command line . my mistakes did not end with changing just that $localhost$ though :) . i had the total concept wrong , i had the plugin installed in the remote server and was pointing to that . your suggestion made me lookup all the path concept and had to change the whole command line ....for SNMP you need to have the plugin locally...
so if there is anyother careless beginners like me, this is what i had to do
> the remote server ( the server which is monitored ) need to have dell open manage installed on it
> on the nagios server , install perl -net-SNMP
>install the check_openmanage plugin ( expecting that nagios and the base plugins are allready installed)
> command declaration should point to the plugin in ur local nagios server
> Run the Pre-flight check and restart nagios
> and VOILA!!!!!!!! your services will all be green :)

Thanks once again Mguthrie for helping ;)

Re: Returns code of 127 is out of bounds - nagios and esx

Posted: Wed Mar 07, 2012 11:23 am
by mguthrie
Thanks for posting your full solution, glad it's working for you!