Create under a convenient directory (such as /tmp
) a C6.X-bundle direcrory then copy there all the needed RPMs and the atlantix-nrpe-installer shell script
mkdir /tmp/bundle
cp -pr /root/SKELETON/atlantix-clients-installer.sh /root/SKELETON/C6.7 /tmp/bundle/
Create a tar.gz archive with all the content:
cd /tmp/
tar -zcvf C6.7-bundle.tar.gz bundle
Under /tmp create the following create-self-bin
script:
#!/bin/bash
BASEDIR=`dirname "${0}"`
cd "$BASEDIR"
payload=$1
script=$2
tmp=__extract__$RANDOM
[ "$payload" != "" ] || read -e -p "Enter the path of the tar archive: " payload
[ "$script" != "" ] || read -e -p "Enter the name/path of the script: " script
printf "#!/bin/bash
PAYLOAD_LINE=\`awk '/^__PAYLOAD_BELOW__/ {print NR + 1; exit 0; }' \$0\`
tail -n+\$PAYLOAD_LINE \$0 | tar -xvz
#you can add custom installation command here
exit 0
__PAYLOAD_BELOW__\n" > "$tmp"
cat "$tmp" "$payload" > "$script" && rm "$tmp"
chmod +x "$script"
and make it executable
chmod +x create-self-bin
Now run the create-self-bin
script with the following parameters to generate a self-extract.bin
script in the same directory
./create-self-bin /tmp/C6.7-bundle.tar.gz /tmp/self-extract.bin
The self-extract.bin
now contains all we need to push our nrpe and ocsinventory agents on a target Centos server.
In order to push the agent to the target server you have to follow these steps:
- Copy the generated
self-extract.bin
file somewhere (/tmp
for example) in the target server - Run it:
./self-extract.bin
- Finally enter the folder created upon self extraction ends (
cd bundle
) and run the nrpe installer with appropriate paremeters:
./atlantix-clients-installer.sh <atlantix-site-controller-IP> [local]
Done!
Reference: http://community.linuxmint.com/tutorial/view/1998