Permalink
Browse files

Begin preparations for new check commands

  • Loading branch information...
NEMS Linux
NEMS Linux committed Oct 29, 2018
1 parent ac0aec9 commit ce60fdbc83e3bca6210db586e11a10857c9ec88e
Showing with 8 additions and 17 deletions.
  1. +1 −0 build-version
  2. +5 −5 nems-build.sh
  3. +2 −12 nems-push-db.sh
@@ -0,0 +1 @@
1.5
@@ -16,7 +16,7 @@ if [[ $EUID -ne 0 ]]; then
exit 1
else
export ver=$1
ver=$(cat /root/nems/nems-admin/build-version)
if [ -z $ver ]; then
@@ -32,7 +32,7 @@ This program is NOT for end-users.
If you run this program, you will lose everything!
"
echo "Usage: $0 [version] [hw_num]"
echo "Usage: $0 [hw_num]"
exit
fi
@@ -54,8 +54,8 @@ echo "version=$ver" > nems.conf
chown www-data:www-data nems.conf
# Detect hardware
if [ ! -z $2 ]; then
echo $2 > /etc/.nems_hw_model_identifier
if [ ! -z $1 ]; then
echo $1 > /etc/.nems_hw_model_identifier
fi
wget -O /tmp/hw_model.sh https://raw.githubusercontent.com/Cat5TV/nems-scripts/master/hw_model.sh
chmod +x /tmp/hw_model.sh
@@ -138,7 +138,7 @@ echo ""
# NIC on Pine64 boards need eth0 to be set to DHCP
# Could probably do this on all boards that use eth0
if (( $2 >= 40 )) && (( $2 <= 49 )); then
if (( $1 >= 40 )) && (( $1 <= 49 )); then
#echo "source /etc/network/interfaces.d/*" > /etc/network/interfaces # https://askubuntu.com/a/854226
#echo "allow-hotplug eth0
#iface eth0 inet dhcp" > /etc/network/interfaces.d/eth0
@@ -1,30 +1,20 @@
#!/bin/bash
# Lock in and push the current database state (including Nagios configs) to NEMS-Migrator
# Built for creating new sample hosts and services, and pushing to all other NEMS servers
# NEMS 1.4+ only
# Requires NEMS 1.4+
# Remove nconf history, should it exist
mysql -u nconf -pnagiosadmin nconf -e "TRUNCATE History"
systemctl stop nagios
systemctl stop mysql
cd /root/nems/nems-migrator/data/1.4/
cd /root/nems/nems-migrator/data/1.5/
if [[ -d mysql ]]; then
rm -rf mysql
fi
cp -R /var/lib/mysql .
#cd nagios/conf
#if [[ -d Default_collector ]]; then
# rm -rf Default_collector
#fi
#if [[ -d global ]]; then
# rm -rf global
#fi
#cp -R /etc/nems/conf/Default_collector .
#cp -R /etc/nems/conf/global .
systemctl start mysql
systemctl start nagios

0 comments on commit ce60fdb

Please sign in to comment.