h3c switch monitoring by SNMP

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
huytq1786
Posts: 21
Joined: Tue Dec 20, 2016 9:50 pm

h3c switch monitoring by SNMP

Post by huytq1786 »

Dear All
I just installed Nagios Core, and now i would like to monitoring H3C switch by SNMP, But i got error:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_snmp, ...) failed. errno is 2: No such file or directory

this is my switch.cfg file:

check_command check_snmp! -C 123456 -o sysUptime.0

i already configed on H3C switch as: snmp-agent community write 123456
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: h3c switch monitoring by SNMP

Post by mcapra »

Can you share the full output of the following command executed from the CLI of your Nagios Core machine:

Code: Select all

ls -al /usr/local/nagios/libexec/
Former Nagios employee
https://www.mcapra.com/
huytq1786
Posts: 21
Joined: Tue Dec 20, 2016 9:50 pm

Re: h3c switch monitoring by SNMP

Post by huytq1786 »

Thank you

Code: Select all

[root@localhost ~]# ls -al /usr/local/nagios/libexec
total 6728
drwxrwxr-x. 3 nagios nagios   4096 Dec 20 00:37 .
drwxr-xr-x. 9 root   root       94 Dec 20 00:37 ..
-rwxr-xr-x. 1 nagios nagios 208624 Dec 20 00:37 check_apt
-rwxr-xr-x. 1 nagios nagios   2346 Dec 20 00:37 check_breeze
-rwxr-xr-x. 1 nagios nagios 212736 Dec 20 00:37 check_by_ssh
lrwxrwxrwx. 1 root   root        9 Dec 20 00:37 check_clamd -> check_tcp
-rwxr-xr-x. 1 nagios nagios 161120 Dec 20 00:37 check_cluster
-r-sr-xr-x. 1 root   nagios 210416 Dec 20 00:37 check_dhcp
-rwxr-xr-x. 1 nagios nagios 221072 Dec 20 00:37 check_dig
-rwxr-xr-x. 1 nagios nagios 225440 Dec 20 00:37 check_disk
-rwxr-xr-x. 1 nagios nagios   9385 Dec 20 00:37 check_disk_smb
-rwxr-xr-x. 1 nagios nagios 228400 Dec 20 00:37 check_dns
-rwxr-xr-x. 1 nagios nagios 125104 Dec 20 00:37 check_dummy
-rwxr-xr-x. 1 nagios nagios   3604 Dec 20 00:37 check_file_age
-rwxr-xr-x. 1 nagios nagios   6412 Dec 20 00:37 check_flexlm
lrwxrwxrwx. 1 root   root        9 Dec 20 00:37 check_ftp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 306832 Dec 20 00:37 check_http
-r-sr-xr-x. 1 root   nagios 225144 Dec 20 00:37 check_icmp
-rwxr-xr-x. 1 nagios nagios 168000 Dec 20 00:37 check_ide_smart
-rwxr-xr-x. 1 nagios nagios  15275 Dec 20 00:37 check_ifoperstatus
-rwxr-xr-x. 1 nagios nagios  13423 Dec 20 00:37 check_ifstatus
lrwxrwxrwx. 1 root   root        9 Dec 20 00:37 check_imap -> check_tcp
-rwxr-xr-x. 1 nagios nagios   6984 Dec 20 00:37 check_ircd
-rwxr-xr-x. 1 nagios nagios 185752 Dec 20 00:37 check_load
-rwxr-xr-x. 1 nagios nagios   6595 Dec 20 00:37 check_log
-rwxr-xr-x. 1 nagios nagios  22756 Dec 20 00:37 check_mailq
-rwxr-xr-x. 1 nagios nagios 167184 Dec 20 00:37 check_mrtg
-rwxr-xr-x. 1 nagios nagios 168544 Dec 20 00:37 check_mrtgtraf
-rwxr-xr-x. 1 nagios nagios 184984 Dec 20 00:37 check_nagios
lrwxrwxrwx. 1 root   root        9 Dec 20 00:37 check_nntp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 218128 Dec 20 00:37 check_nt
-rwxr-xr-x. 1 nagios nagios 216944 Dec 20 00:37 check_ntp
-rwxr-xr-x. 1 nagios nagios 206448 Dec 20 00:37 check_ntp_peer
-rwxr-xr-x. 1 nagios nagios 201616 Dec 20 00:37 check_ntp_time
-rwxr-xr-x. 1 nagios nagios 248576 Dec 20 00:37 check_nwstat
-rwxr-xr-x. 1 nagios nagios   8926 Dec 20 00:37 check_oracle
-rwxr-xr-x. 1 nagios nagios 191320 Dec 20 00:37 check_overcr
-rwxr-xr-x. 1 nagios nagios 221512 Dec 20 00:37 check_ping
lrwxrwxrwx. 1 root   root        9 Dec 20 00:37 check_pop -> check_tcp
-rwxr-xr-x. 1 nagios nagios 218160 Dec 20 00:37 check_procs
-rwxr-xr-x. 1 nagios nagios 183936 Dec 20 00:37 check_real
-rwxr-xr-x. 1 nagios nagios   9679 Dec 20 00:37 check_rpc
-rwxr-xr-x. 1 nagios nagios   1465 Dec 20 00:37 check_sensors
-rwxr-xr-x. 1 nagios nagios 214792 Dec 20 00:37 check_smtp
-rwxr-xr-x. 1 nagios nagios 183432 Dec 20 00:37 check_ssh
-rwxr-xr-x. 1 nagios nagios 164760 Dec 20 00:37 check_swap
-rwxr-xr-x. 1 nagios nagios 200088 Dec 20 00:37 check_tcp
-rwxr-xr-x. 1 nagios nagios 185232 Dec 20 00:37 check_time
lrwxrwxrwx. 1 root   root        9 Dec 20 00:37 check_udp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 197744 Dec 20 00:37 check_ups
-rwxr-xr-x. 1 nagios nagios 161560 Dec 20 00:37 check_uptime
-rwxr-xr-x. 1 nagios nagios 156168 Dec 20 00:37 check_users
-rwxr-xr-x. 1 nagios nagios   3032 Dec 20 00:37 check_wave
drwxr-xr-x. 4 root   root      221 Dec 20 00:28 eventhandlers
-rwxr-xr-x. 1 nagios nagios 151624 Dec 20 00:37 negate
-rwxr-xr-x. 1 nagios nagios 149296 Dec 20 00:37 urlize
-rwxr-xr-x. 1 nagios nagios   1949 Dec 20 00:37 utils.pm
-rwxr-xr-x. 1 nagios nagios   2791 Dec 20 00:37 utils.sh
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: h3c switch monitoring by SNMP

Post by rkennedy »

It looks like you're missing the check_snmp plugin, which is included with the most recent version of nagios-plugins. I would download the most recent one here, and then re-compile them. https://www.nagios.org/downloads/nagios-plugins/

I verified on my end, and here are the plugins you should see (after compiling 2.1.4) -

Code: Select all

[root@bob libexec]# ls
check_apt       check_flexlm        check_ircd      check_nntps     check_pop      check_ssh     check_wave
check_breeze    check_ftp           check_jabber    check_nt        check_procs    check_ssmtp   negate
check_clamd     check_hpjd          check_load      check_ntp       check_real     check_swap    old
check_cluster   check_http          check_log       check_ntp_peer  check_rpc      check_tcp     urlize
check_dhcp      check_icmp          check_mailq     check_ntp_time  check_sensors  check_time    utils.pm
check_disk      check_ide_smart     check_mrtg      check_nwstat    check_simap    check_udp     utils.sh
check_disk_smb  check_ifoperstatus  check_mrtgtraf  check_oracle    check_smtp     check_ups
check_dummy     check_ifstatus      check_nagios    check_overcr    check_snmp     check_uptime
check_file_age  check_imap          check_nntp      check_ping      check_spop     check_users
Former Nagios Employee
huytq1786
Posts: 21
Joined: Tue Dec 20, 2016 9:50 pm

Re: h3c switch monitoring by SNMP

Post by huytq1786 »

here is my result:
check_apt check_dhcp check_dummy check_icmp check_ircd check_mrtgtraf check_ntp_peer check_ping check_sensors check_time check_wave utils.sh
check_breeze check_dig check_file_age check_ide_smart check_load check_nagios check_ntp_time check_pop check_smtp check_udp eventhandlers
check_by_ssh check_disk check_flexlm check_ifoperstatus check_log check_nntp check_nwstat check_procs check_ssh check_ups negate
check_clamd check_disk_smb check_ftp check_ifstatus check_mailq check_nt check_oracle check_real check_swap check_uptime urlize
check_cluster check_dns check_http check_imap check_mrtg check_ntp check_overcr check_rpc check_tcp check_users utils.pm
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: h3c switch monitoring by SNMP

Post by rhassing »

It could be you're missing some dependencies and then the check_snmp file will not be compiled.

Please check:

Code: Select all

ls -al /usr/local/nagios/libexec/check_snmp*
To verify if snmp is configured correctly, please try:

Code: Select all

snmpwalk -v2c -c 123456 h3cswitch_ip_address sysUptime.0
Rob Hassing
Image
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: h3c switch monitoring by SNMP

Post by rkennedy »

Thanks @rhassing!

@huytq1786 - if you recompiled once again with the latest version then what @rhassing mentioned is correct, you may be missing pre-reqs.
Former Nagios Employee
huytq1786
Posts: 21
Joined: Tue Dec 20, 2016 9:50 pm

Re: h3c switch monitoring by SNMP

Post by huytq1786 »

rhassing wrote:It could be you're missing some dependencies and then the check_snmp file will not be compiled.

Please check:

Code: Select all

ls -al /usr/local/nagios/libexec/check_snmp*
To verify if snmp is configured correctly, please try:

Code: Select all

snmpwalk -v2c -c 123456 h3cswitch_ip_address sysUptime.0
Thank you

[root@localhost ~]# cd /usr/local/nagios/libexec
[root@localhost libexec]# ls

check_apt check_http check_nt check_ssh
check_breeze check_icmp check_ntp check_swap
check_by_ssh check_ide_smart check_ntp_peer check_tcp
check_clamd check_ifoperstatus check_ntp_time check_time
check_cluster check_ifstatus check_nwstat check_udp
check_dhcp check_imap check_oracle check_ups
check_dig check_ircd check_overcr check_uptime
check_disk check_load check_ping check_users
check_disk_smb check_log check_pop check_wave
check_dns check_mailq check_procs eventhandlers
check_dummy check_mrtg check_real negate
check_file_age check_mrtgtraf check_rpc urlize
check_flexlm check_nagios check_sensors utils.pm
check_ftp check_nntp check_smtp utils.sh

i did not see check_snmp. i already installed the latest of plugin. :(
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: h3c switch monitoring by SNMP

Post by rkennedy »

Please post the output from the configure for the section, something like this -

Code: Select all

config.status: creating po/Makefile
            --with-apt-get-command:
              --with-ping6-command: /bin/ping6 -n -U -w %d -c %d %s
               --with-ping-command: /bin/ping -n -U -w %d -c %d %s
                       --with-ipv6: yes
                      --with-mysql: no
                    --with-openssl: yes
                     --with-gnutls: no
               --enable-extra-opts: yes
                       --with-perl: /usr/bin/perl
             --enable-perl-modules: no
                     --with-cgiurl: /nagios/cgi-bin
               --with-trusted-path: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
                   --enable-libtap: no
Also, what is the output of rpm -qa | grep 'net-snmp'?
Former Nagios Employee
huytq1786
Posts: 21
Joined: Tue Dec 20, 2016 9:50 pm

Re: h3c switch monitoring by SNMP

Post by huytq1786 »

rkennedy wrote:Please post the output from the configure for the section, something like this -

Code: Select all

config.status: creating po/Makefile
            --with-apt-get-command:
              --with-ping6-command: /bin/ping6 -n -U -w %d -c %d %s
               --with-ping-command: /bin/ping -n -U -w %d -c %d %s
                       --with-ipv6: yes
                      --with-mysql: no
                    --with-openssl: yes
                     --with-gnutls: no
               --enable-extra-opts: yes
                       --with-perl: /usr/bin/perl
             --enable-perl-modules: no
                     --with-cgiurl: /nagios/cgi-bin
               --with-trusted-path: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
                   --enable-libtap: no
Also, what is the output of rpm -qa | grep 'net-snmp'?
Sorry , but i do not know what the command i can get output like you show :(
Locked