PDA

View Full Version : [ubuntu] nagios plugin installation issue



mascir
August 10th, 2012, 10:53 AM
hi All,

i tried to install the check_snmp plugin (vers 1.4) on my Ubuntu 12.04 32 bit server. I have installed NET-SNMP and snmpd.

So the ./configure command works, but when i tried to send make...


depbase=`echo src/check_snmp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; \
if gcc -DHAVE_CONFIG_H -I. -I. -I./inc -I./inc -fno-strict-aliasing -g -O2 -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.14/CORE -I/usr/local/include -g -O2 -MT src/check_snmp.o -MD -MP -MF "$depbase.Tpo" -c -o src/check_snmp.o src/check_snmp.c; \
then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit 1; fi
In file included from src/check_snmp.c:24:0:
./inc/check_snmp.h:107:32: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
./inc/check_snmp.h:107:32: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
./inc/check_snmp.h:108:62: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
./inc/check_snmp.h:109:60: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
./inc/check_snmp.h:110:60: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
./inc/check_snmp.h:111:59: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
src/check_snmp.c:28:68: warning: ‚struct snmp_pdu‚ declared inside parameter list [enabled by default]
src/check_snmp.c: In function ‚check_snmp‚:
src/check_snmp.c:61:25: error: storage size of ‚init‚ isn‚t known
src/check_snmp.c:63:5: error: unknown type name ‚oid‚
src/check_snmp.c:63:19: error: ‚MAX_OID_LEN‚ undeclared (first use in this function)
src/check_snmp.c:63:19: note: each undeclared identifier is reported only once for each function it appears in
src/check_snmp.c:73:20: error: ‚SNMP_VERSION_2c‚ undeclared (first use in this function)
src/check_snmp.c:89:42: error: ‚SNMP_MSG_GETNEXT‚ undeclared (first use in this function)
src/check_snmp.c:89:61: error: ‚SNMP_MSG_GET‚ undeclared (first use in this function)
src/check_snmp.c:95:60: error: ‚snmp_errno‚ undeclared (first use in this function)
src/check_snmp.c:104:14: error: ‚STAT_SUCCESS‚ undeclared (first use in this function)
src/check_snmp.c:105:29: error: dereferencing pointer to incomplete type
src/check_snmp.c:106:22: error: ‚SNMP_ERR_NOERROR‚ undeclared (first use in this function)
src/check_snmp.c:107:21: warning: passing argument 2 of ‚check_snmp_response‚ from incompatible pointer type [enabled by default]
src/check_snmp.c:28:12: note: expected ‚struct snmp_pdu *‚ but argument is of type ‚struct snmp_pdu *‚
src/check_snmp.c:112:56: error: dereferencing pointer to incomplete type
src/check_snmp.c:117:14: error: ‚STAT_ERROR‚ undeclared (first use in this function)
src/check_snmp.c:122:14: error: ‚STAT_TIMEOUT‚ undeclared (first use in this function)
src/check_snmp.c: At top level:
src/check_snmp.c:164:61: warning: ‚struct snmp_pdu‚ declared inside parameter list [enabled by default]
src/check_snmp.c:164:1: error: conflicting types for ‚check_snmp_response‚
src/check_snmp.c:28:12: note: previous declaration of ‚check_snmp_response‚ was here
src/check_snmp.c: In function ‚check_snmp_response‚:
src/check_snmp.c:167:42: error: dereferencing pointer to incomplete type
src/check_snmp.c:170:13: warning: passing argument 2 of ‚check_snmp_intervals‚ from incompatible pointer type [enabled by default]
./inc/check_snmp.h:108:5: note: expected ‚struct variable_list *‚ but argument is of type ‚struct variable_list *‚
src/check_snmp.c:173:13: warning: passing argument 2 of ‚check_snmp_strings‚ from incompatible pointer type [enabled by default]
./inc/check_snmp.h:109:5: note: expected ‚struct variable_list *‚ but argument is of type ‚struct variable_list *‚
src/check_snmp.c:176:13: warning: passing argument 2 of ‚check_snmp_regexes‚ from incompatible pointer type [enabled by default]
./inc/check_snmp.h:110:5: note: expected ‚struct variable_list *‚ but argument is of type ‚struct variable_list *‚
src/check_snmp.c:179:13: warning: passing argument 2 of ‚check_snmp_simple‚ from incompatible pointer type [enabled by default]
./inc/check_snmp.h:111:5: note: expected ‚struct variable_list *‚ but argument is of type ‚struct variable_list *‚
src/check_snmp.c: At top level:
src/check_snmp.c:186:28: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
src/check_snmp.c:186:1: error: conflicting types for ‚check_snmp_var_type‚
./inc/check_snmp.h:107:5: note: previous declaration of ‚check_snmp_var_type‚ was here
src/check_snmp.c: In function ‚check_snmp_var_type‚:
src/check_snmp.c:188:14: error: dereferencing pointer to incomplete type
src/check_snmp.c:189:14: error: ‚SNMP_NOSUCHOBJECT‚ undeclared (first use in this function)
src/check_snmp.c:190:14: error: ‚SNMP_NOSUCHINSTANCE‚ undeclared (first use in this function)
src/check_snmp.c: In function ‚check_snmp_get_value‚:
src/check_snmp.c:203:16: error: ‚ASN_APPLICATION‚ undeclared (first use in this function)
src/check_snmp.c: At top level:
src/check_snmp.c:28:12: warning: ‚check_snmp_response‚ used but never defined [enabled by default]
make: *** [src/check_snmp.o] Errore 1
mascir@nagios:~/check_snmp-1.4$
mascir@nagios:~/check_snmp-1.4$
mascir@nagios:~/check_snmp-1.4$
mascir@nagios:~/check_snmp-1.4$ make
depbase=`echo src/check_snmp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; \
if gcc -DHAVE_CONFIG_H -I. -I. -I./inc -I./inc -fno-strict-aliasing -g -O2 -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.14/CORE -I/usr/local/include -g -O2 -MT src/check_snmp.o -MD -MP -MF "$depbase.Tpo" -c -o src/check_snmp.o src/check_snmp.c; \
then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit 1; fi
In file included from src/check_snmp.c:24:0:
./inc/check_snmp.h:107:32: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
./inc/check_snmp.h:107:32: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
./inc/check_snmp.h:108:62: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
./inc/check_snmp.h:109:60: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
./inc/check_snmp.h:110:60: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
./inc/check_snmp.h:111:59: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
src/check_snmp.c:28:68: warning: ‚struct snmp_pdu‚ declared inside parameter list [enabled by default]
src/check_snmp.c: In function ‚check_snmp‚:
src/check_snmp.c:61:25: error: storage size of ‚init‚ isn‚t known
src/check_snmp.c:63:5: error: unknown type name ‚oid‚
src/check_snmp.c:63:19: error: ‚MAX_OID_LEN‚ undeclared (first use in this function)
src/check_snmp.c:63:19: note: each undeclared identifier is reported only once for each function it appears in
src/check_snmp.c:73:20: error: ‚SNMP_VERSION_2c‚ undeclared (first use in this function)
src/check_snmp.c:89:42: error: ‚SNMP_MSG_GETNEXT‚ undeclared (first use in this function)
src/check_snmp.c:89:61: error: ‚SNMP_MSG_GET‚ undeclared (first use in this function)
src/check_snmp.c:95:60: error: ‚snmp_errno‚ undeclared (first use in this function)
src/check_snmp.c:104:14: error: ‚STAT_SUCCESS‚ undeclared (first use in this function)
src/check_snmp.c:105:29: error: dereferencing pointer to incomplete type
src/check_snmp.c:106:22: error: ‚SNMP_ERR_NOERROR‚ undeclared (first use in this function)
src/check_snmp.c:107:21: warning: passing argument 2 of ‚check_snmp_response‚ from incompatible pointer type [enabled by default]
src/check_snmp.c:28:12: note: expected ‚struct snmp_pdu *‚ but argument is of type ‚struct snmp_pdu *‚
src/check_snmp.c:112:56: error: dereferencing pointer to incomplete type
src/check_snmp.c:117:14: error: ‚STAT_ERROR‚ undeclared (first use in this function)
src/check_snmp.c:122:14: error: ‚STAT_TIMEOUT‚ undeclared (first use in this function)
src/check_snmp.c: At top level:
src/check_snmp.c:164:61: warning: ‚struct snmp_pdu‚ declared inside parameter list [enabled by default]
src/check_snmp.c:164:1: error: conflicting types for ‚check_snmp_response‚
src/check_snmp.c:28:12: note: previous declaration of ‚check_snmp_response‚ was here
src/check_snmp.c: In function ‚check_snmp_response‚:
src/check_snmp.c:167:42: error: dereferencing pointer to incomplete type
src/check_snmp.c:170:13: warning: passing argument 2 of ‚check_snmp_intervals‚ from incompatible pointer type [enabled by default]
./inc/check_snmp.h:108:5: note: expected ‚struct variable_list *‚ but argument is of type ‚struct variable_list *‚
src/check_snmp.c:173:13: warning: passing argument 2 of ‚check_snmp_strings‚ from incompatible pointer type [enabled by default]
./inc/check_snmp.h:109:5: note: expected ‚struct variable_list *‚ but argument is of type ‚struct variable_list *‚
src/check_snmp.c:176:13: warning: passing argument 2 of ‚check_snmp_regexes‚ from incompatible pointer type [enabled by default]
./inc/check_snmp.h:110:5: note: expected ‚struct variable_list *‚ but argument is of type ‚struct variable_list *‚
src/check_snmp.c:179:13: warning: passing argument 2 of ‚check_snmp_simple‚ from incompatible pointer type [enabled by default]
./inc/check_snmp.h:111:5: note: expected ‚struct variable_list *‚ but argument is of type ‚struct variable_list *‚
src/check_snmp.c: At top level:
src/check_snmp.c:186:28: warning: ‚struct variable_list‚ declared inside parameter list [enabled by default]
src/check_snmp.c:186:1: error: conflicting types for ‚check_snmp_var_type‚
./inc/check_snmp.h:107:5: note: previous declaration of ‚check_snmp_var_type‚ was here
src/check_snmp.c: In function ‚check_snmp_var_type‚:
src/check_snmp.c:188:14: error: dereferencing pointer to incomplete type
src/check_snmp.c:189:14: error: ‚SNMP_NOSUCHOBJECT‚ undeclared (first use in this function)
src/check_snmp.c:190:14: error: ‚SNMP_NOSUCHINSTANCE‚ undeclared (first use in this function)
src/check_snmp.c: In function ‚check_snmp_get_value‚:
src/check_snmp.c:203:16: error: ‚ASN_APPLICATION‚ undeclared (first use in this function)
src/check_snmp.c: At top level:
src/check_snmp.c:28:12: warning: ‚check_snmp_response‚ used but never defined [enabled by default]
make: *** [src/check_snmp.o] Errore 1


i have installed also MRTG on this server, it works fine. A little bit strange is the Nagios alert "check_mrtgtraf: Unable to open MRTG log file". It's all connected?

Thanx in advance :)

LHammonds
August 10th, 2012, 02:22 PM
Check my sig for how I have my Nagios server built.

mascir
August 10th, 2012, 10:15 PM
Check my sig for how I have my Nagios server built.

Thanx! i solved with your guide :)

LHammonds
August 11th, 2012, 03:04 AM
=d>

mascir
August 11th, 2012, 11:25 AM
=d>

here again :(

strange issue with nagios....

"External command error: MIB search path: $HOME/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp"

it seems a problem on a mib path...i tried to googling in order to find a fix...nothing.

Could you help me?

cheers

LHammonds
August 12th, 2012, 01:42 AM
What are you doing to see that error? Is it in the web application, the command line, what?

mascir
August 12th, 2012, 10:33 AM
What are you doing to see that error? Is it in the web application, the command line, what?

After i started Nagios i tried to configure some services in order to check my router.


i use this following config in "router.cfg"



# Monitor Port 1 status via SNMP

define service{
use generic-service ; Inherit values from a template
host_name P-660HN-F1Z
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}

and the following config in "commands.cfg":


# 'check_snmp' command definition
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}

After i restarted nagios (check config OK!) in the web interface i found the error. The other SNMP command (check_local_mrtgtraf) works fine.

cheers,

koenn
August 12th, 2012, 04:57 PM
I'm guessing the plugin is looking for the RFC1213-MIB and can't find it on the "MIB path". maybe it's not event present on your system at all.

mascir
August 13th, 2012, 12:05 AM
I'm guessing the plugin is looking for the RFC1213-MIB and can't find it on the "MIB path". maybe it's not event present on your system at all.

thank u for the reply...

i was pretty sure that the "apt-get install snmp" and "perl -MCPAN -e 'install Net::SNMP' " would also install the mib's

I can verify their presence with a few commands?
if not, how can I install it?
may i download and copy in a directory and then change the path of the command?

cheers

mascir
August 13th, 2012, 01:07 AM
thank u for the reply...

i was pretty sure that the "apt-get install snmp" and "perl -MCPAN -e 'install Net::SNMP' " would also install the mib's

I can verify their presence with a few commands?
if not, how can I install it?
may i download and copy in a directory and then change the path of the command?

cheers

i downloaded the file (rfc1213.mib), I copied in /usr/share/mibs/netsnmp the same in /home/USER/.snmp/mibs/ renamed the file in RFC1213-MIB as it invokes from command config,
# Monitor Port 1 status via SNMP

define service{
use generic-service ; Inherit values from a template
host_name P-660HN-F1Z
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}

same issue! :(

suggestions?

mascir
August 13th, 2012, 01:44 AM
i downloaded the file (rfc1213.mib), I copied in /usr/share/mibs/netsnmp the same in /home/USER/.snmp/mibs/ renamed the file in RFC1213-MIB as it invokes from command config,
# Monitor Port 1 status via SNMP

define service{
use generic-service ; Inherit values from a template
host_name P-660HN-F1Z
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}

same issue! :(

suggestions?

FIXED!

sudo sudo apt-get install snmp-mibs-downloader

it works! :))))

koenn
August 13th, 2012, 05:25 PM
FIXED!

sudo sudo apt-get install snmp-mibs-downloader

it works! :)

good to hear that.

thanks for the feedback; I might need that some day. :-)