-
Strange SCP problem...
[SOLVED?
Ooops - I think it's OK now - I think I make a simple error and got my files mixed up.]
I have
1. a Ubuntu server (64 bit) running as a central Nagios server
2. 5 Centos (32 bit) servers running a turnkey solution.
I need to monitor the 5 Centos servers, so I installed Nagios NRPE agent on them. I have compiled a set of Nagios plugins for the 32 bit Centos machines, these work well and function correctly; there is no problem as far as the monitoring or plugins are concerned.
The problem - I SCP'd the compiled plugins from the Centos machine to the Ubuntu server.
I wrote a script to SCP the plugins to all the other servers.
When this SCP takes place (from the Ubuntu machine to the Centos machines), the binary plugins do not run on the Centos servers - it's as if they've been corrupted (or compiled under the wrong architecture).
For instance, if I try to run the check_ntp plugin, I get the message "-bash: ./check_ntp: cannot execute binary file"
Now this is the wierd part - if I try the plugin on the Ubuntu server, the plugin works! But it shouldn't work! It was compiled for a 32 bit Centos server.
In summary:
1. The plugins work on a Centos server, before any SCP takes place.
2. I SCP the plugins to the Ubuntu server - this is acting as my source file server.
3. I SCP from the Ubuntu server to the Centos servers. The plugins now do not work.
The SCP path of the files:
Centos > Ubuntu > Centos
..^.............^.............^......
works ........works*.....broken
* but shouldn't work - wrong architecture!
I thought SCP always did a straight binary transfer?
My best guess is that something funny is happening when the SCP'd file hits the Ubuntu server. Is Ubuntu doing something odd to the binary to make it work on its architecture?
By the way, I kept a copy of the binary file on a Centos server, to compare with a file that has travelled to and from the Ubuntu server. A 'diff' shows that the file has changed ["Binary files check_ftp and /tmp/check_ftp differ"]
I'm stumped over this one...
Anyone help?
-
Also, the Centos servers are using ext3, Ubuntu server is using ext4. I doubt this could have any bearing.
-
OK , I think I made a stupid error. It's working now, I think I might have done something as stupid as copying the wrong set of file.
:o
The Ubuntu Nagios plugins were in the path; I wasn't calling them with the ./ so it appeared as if the 32 bit plugins were working on the 64 bit server. Silly me.