How can I run Nagios plugins on the command line?

Although the GroundWork Monitor Configuration interface allows you to test plugins, sometimes you may want to run them in a command line shell. This might be because you are developing a new plugin or if you want to take the output and repurpose it for some other system administration task.

Many plugins in GroundWork Monitor are pre-compiled. Both these plugins and Perl plugins often require access to libraries of subroutines to run correctly. These libraries are located in various locations on the server. GroundWork provides the correct environment for the user 'nagios' to find these libraries automatically. Trying to run plugins as another user without that correct environment will usually result in an error such as:

/usr/local/groundwork/nagios/libexec/check_http: error while loading shared libraries: cannot open shared object file: No such file or directory

If you absolutely need to run plugins as a user other than 'nagios' you can do so by first running an environment set-up script. It is the same script that is executed for the user 'nagios' when that user first logs in to an interactive shell.

source /usr/local/groundwork/scripts/

After running the above shell script you can correctly run the pre-compiled and Perl plugins.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.