How to install Nagios plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jamesc23
Posts: 82
Joined: Thu Jan 15, 2015 11:55 pm

How to install Nagios plugin

Post by jamesc23 »

Hi,

I need up install a particular plugin from the latest Nagios plugin but I have no idea where to start.

I didn't find much from google search except for a few comments regarding the run of make all or make check_http.c

I executed this and I got the below result

cc check_http.c -o check_http
In file included from check_http.c:40:
common.h:34:20: error: config.h: No such file or directory
common.h:118:21: error: dirname.h: No such file or directory
common.h:209:21: error: gettext.h: No such file or directory
In file included from netutils.h:35,
from check_http.c:41:
utils.h:17:24: error: utils_base.h: No such file or directory
In file included from netutils.h:35,
from check_http.c:41:
utils.h:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘timeout_alarm_handler’
utils.h:59: error: redefinition of ‘struct timeval’
utils.h:66: warning: ‘struct timezone’ declared inside parameter list
utils.h:66: warning: its scope is only this definition or declaration, which is probably not what you want
utils.h:79: error: expected declaration specifiers or ‘...’ before ‘va_list’
In file included from check_http.c:41:
netutils.h:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘socket_timeout_alarm_handler’
check_http.c:43:20: error: base64.h: No such file or directory
check_http.c:109: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
check_http.c: In function ‘main’:
check_http.c:159: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:160: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:162: error: ‘NP_VERSION’ undeclared (first use in this function)
check_http.c:162: error: (Each undeclared identifier is reported only once
check_http.c:162: error: for each function it appears in.)
check_http.c:162: error: ‘VERSION’ undeclared (first use in this function)
check_http.c:168: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:176: error: ‘SIGALRM’ undeclared (first use in this function)
check_http.c:176: error: ‘socket_timeout_alarm_handler’ undeclared (first use in this function)
check_http.c: In function ‘test_file’:
check_http.c:190: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c: In function ‘process_arguments’:
check_http.c:250: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:275: error: ‘NP_VERSION’ undeclared (first use in this function)
check_http.c:365: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:392: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:394: warning: incompatible implicit declaration of built-in function ‘strstr’
check_http.c:396: warning: incompatible implicit declaration of built-in function ‘strchr’
check_http.c:405: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:416: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:486: warning: assignment makes pointer from integer without a cast
check_http.c:493: warning: assignment makes pointer from integer without a cast
check_http.c:533: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:540: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:545: error: ‘thlds’ undeclared (first use in this function)
check_http.c:554: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c: In function ‘parse_time_string’:
check_http.c:584: warning: incompatible implicit declaration of built-in function ‘memset’
check_http.c: In function ‘expected_statuscode’:
check_http.c:677: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:678: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:680: warning: assignment makes pointer from integer without a cast
check_http.c:680: warning: assignment makes pointer from integer without a cast
check_http.c:681: warning: incompatible implicit declaration of built-in function ‘strstr’
check_http.c: In function ‘chunk_header’:
check_http.c:704: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c: In function ‘decode_chunked_page’:
check_http.c:720: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:722: warning: incompatible implicit declaration of built-in function ‘memmove’
check_http.c: In function ‘header_value’:
check_http.c:742: warning: assignment makes pointer from integer without a cast
check_http.c:746: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:751: warning: incompatible implicit declaration of built-in function ‘strchr’
check_http.c:761: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:764: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:765: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c: In function ‘check_document_dates’:
check_http.c:836: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:852: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:855: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:862: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:865: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:868: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:873: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:876: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c: In function ‘get_content_length’:
check_http.c:928: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c: In function ‘prepend_slash’:
check_http.c:947: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:948: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:950: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c: In function ‘check_http’:
check_http.c:992: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:1009: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:1095: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:1129: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:1195: warning: incompatible implicit declaration of built-in function ‘strcspn’
check_http.c:1215: warning: incompatible implicit declaration of built-in function ‘strspn’
check_http.c:1255: warning: incompatible implicit declaration of built-in function ‘strchr’
check_http.c:1307: warning: incompatible implicit declaration of built-in function ‘strstr’
check_http.c:1308: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:1310: warning: incompatible implicit declaration of built-in function ‘bcopy’
check_http.c:1318: warning: incompatible implicit declaration of built-in function ‘strstr’
check_http.c:1319: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:1321: warning: incompatible implicit declaration of built-in function ‘bcopy’
check_http.c:1394: error: ‘thlds’ undeclared (first use in this function)
check_http.c: In function ‘redir’:
check_http.c:1428: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c:1430: warning: incompatible implicit declaration of built-in function ‘memset’
check_http.c:1431: warning: incompatible implicit declaration of built-in function ‘strcspn’
check_http.c:1439: warning: incompatible implicit declaration of built-in function ‘strspn’
check_http.c:1440: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:1448: warning: incompatible implicit declaration of built-in function ‘strspn’
check_http.c:1481: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1487: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1495: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1507: warning: incompatible implicit declaration of built-in function ‘strrchr’
check_http.c:1512: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1539: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1542: warning: incompatible implicit declaration of built-in function ‘strndup’
check_http.c: In function ‘perfd_time’:
check_http.c:1591: error: ‘thlds’ undeclared (first use in this function)
check_http.c: In function ‘print_help’:
check_http.c:1632: error: ‘NP_VERSION’ undeclared (first use in this function)
check_http.c:1637: warning: incompatible implicit declaration of built-in function ‘gettext’
check_http.c: In function ‘print_usage’:
check_http.c:1798: warning: incompatible implicit declaration of built-in function ‘gettext’

Please help.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to install Nagios plugin

Post by mcapra »

It's easier to just build the whole thing in a completely separate directory and then copy the specific plugin you want to /usr/local/nagios/libexec.

Here's the documentation for doing that:
https://support.nagios.com/kb/article/n ... e-569.html

Pro-tip; Most configure scripts offer a --help directive to show you the available directives. Most of them also have a --prefix directive for specifying where you would like the artifact (or binaries in this case) to be written to.

So with the above documentation, when you reach the configure/make steps, you could specify --prefix=/some/other/path in your configure command to have the "updated" plugins be written to /some/other/path rather than overwriting every single one of your current Nagios XI plugins.

Code: Select all

./configure --prefix=/some/other/path
Which would then cause the make install step to dump all the compiled binaries into the /some/other/path/libexec path. Copy the resulting /some/other/path/libexec/check_http to /usr/local/nagios/libexec and you've just "updated" check_http.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: How to install Nagios plugin

Post by kyang »

Thanks @mcapra!

jamesc23, let us know if you have any more questions.
jamesc23
Posts: 82
Joined: Thu Jan 15, 2015 11:55 pm

Re: How to install Nagios plugin

Post by jamesc23 »

Thanks guys. Managed to get the plugin installed.

Will post a new thread regarding issues I'm having with this site I'm trying to monitor.

Cheers.
kyang

Re: How to install Nagios plugin

Post by kyang »

Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!
Locked