Page 1 of 3

check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 11:31 am
by pratik.patel
I have 32-bit linux machine running nagios and I want to use check_snmp3 on it.
I am getting below error:
[root@xxxxx ~]# /usr/lib/nagios/plugins/check_snmpv3 -V
-bash: /usr/lib/nagios/plugins/check_snmpv3: cannot execute binary file

I copied check_snmp3 file from another nagios server that is ruuning on 64 bit linux machine.

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 12:13 pm
by dwhitfield
Do you know where check_snmpv3 came from originally? I don't see it on the exchange. It's not one we install by default.

If it's check_snmp with a different file name, then you can just recompile it: http://nagios-plugins.org/doc/man/check_snmp.html

There are other check_snmp plugins out there, so you'll need to use the link above to see if it is ours, if you are unsure.

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 3:13 pm
by pratik.patel
Its the same check_snmp, I have renamed it to check_snmpv3.
actually nagios server has old plugins and check_snmpv3 is working fine on another server (64-bit Linux server).
I just copied the same on 32-bit nagios Linux machine and getting this error.
How to recompile it to be used on 32-bit mchine ?

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 3:19 pm
by dwhitfield
Your other ticket is in Nagios XI. Is this an XI server or a core server? If it's XI, then you can follow the architecture information at https://assets.nagios.com/downloads/nag ... ios-XI.pdf (page 6). Otherwise, you'll need to follow https://support.nagios.com/kb/article.php?id=515 for your operating system.

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 3:28 pm
by pratik.patel
This issue is with another sever which is nagios core

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 3:51 pm
by dwhitfield
Just find your OS at https://support.nagios.com/kb/article.php?id=515 . If you can't find yours, find the closest thing. If you aren't sure, cat /etc/*-release may be of use.

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 4:00 pm
by pratik.patel
[xxxxxx ~]# cat /etc/*-release
CentOS release 5.11 (Final)

32-bit
Not working here


[xxxxxx ~]$ cat /etc/*-release
CentOS release 6.8 (Final)

64-bit
working fine here

also find the attched check_snmpv3 file

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 4:03 pm
by dwhitfield
You're in luck. CentOS is the very first option at https://support.nagios.com/kb/article.php?id=515. Just make sure you are using the CentOS 5 instructions when it breaks off into different versions.

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 4:15 pm
by pratik.patel
issue is :
[root@xxxxx ~]# /usr/lib/nagios/plugins/check_snmpv3 -V
-bash: /usr/lib/nagios/plugins/check_snmpv3: cannot execute binary file

I am able to run this " /usr/lib/nagios/plugins/check_snmpv3 -V" on 64-bit machine.

Re: check_snmpv3: cannot execute binary file

Posted: Wed May 10, 2017 4:19 pm
by dwhitfield
You just needed to scroll down, but here you go:

Code: Select all

yum install -y gcc glibc glibc-common make gettext automake wget openssl-devel net-snmp net-snmp-utils epel-release
yum install -y perl-Net-SNMP
cd /tmp
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
tar xzf autoconf-2.60.tar.gz 
cd /tmp/autoconf-2.60
./configure 
make
make install
cd /tmp
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.0.tar.gz
tar zxf nagios-plugins.tar.gz
cd /tmp/nagios-plugins-release-2.2.0/
./tools/setup
./configure
make
make install
You could, of course, just recompile check_snmp, you are going to have this issue with any plugin copied from a 64-bit system, so you might as well just recompile all the standard ones.