One of the worst things that can happen to your NEMS deployment is having your SD card fail. So keeping a current backup of your NEMS configuration is a smart idea.
Your NEMS Migrator snapshots are always accessible at http://NEMSIP/backup/ and will automatically generate and send a backup.nems file, which contains all the NEMS configuration settings, logs, data, etc. to allow an easy recovery by restoring to a new NEMS deployment.
Knowing this, it’s easy to add a NEMS backup to your daily backup script.
From your Linux server (where your backups run), simply add this to your backup task:
… where NEMSIP is the actual internal IP address of your NEMS server. From there, I recommend you have your backup script run an rdiff-backup of your /backup folder (in this example) to allow for versioning.
Choose “Complete installation” and if asked, choose to save config to ini file.
Under “Allowed Hosts” it should read 127.0.0.1,NEMSIP (where NEMSIP is the IP address of your NEMS server)
Clear the Password field for ease of deployment. NEMS sample scripts are setup to use NRPE without a password because I’m making the assumption that this is being deployed in a trusted LAN. If you do not blank the password here, you will have to edit all the scripts before NEMS will be able to communicate with this computer.
Enable all modules and change the NRPE mode to Legacy. NEMS uses Nagios 3.5.1 at present, and I suppose that’s technically “Legacy”. 🙂
Screen should look a little something like this:
Add your Windows host to NEMS. If you are using NEMS 1.1+ you can use the template “ourwinserver” in nconf. Just change the hostname and the IP address.
Please note: If you have a software firewall running on your Windows machine, setup an exception for your NEMS server IP to gain access through ports 5666 and 12489.
Thanks for being an early-adopter of NEMS! It’s been exciting to see this project really catching on, and I endeavor to make it the best it can be. Your suggestions along the way have helped me focus on some great features for NEMS 1.1.
But where does that leave you, oh precious NEMS 1.0 user?
Yeah, don’tcha worry; I’m thinking of you too.
NEMS 1.1 has a nifty backup and export tool called NEMS Migrator. While it comes pre-packaged in 1.1, I designed it specifically to run on 1.0 as well, giving you the opportunity to export your NEMS 1.0 configuration, deploy NEMS 1.1, and then restore the configuration to NEMS 1.1. Easy peasy!
Here’s what you need to do:
Note: These instructions are for NEMS 1.0 only. Do not do this on NEMS 1.1+ as the tool is already built-in.
SSH into your NEMS server.
Become root: sudo su
Update repository data. Type: apt-get update
Install Git. Type: apt-get install git
Install NEMS-Migrator in /tmp. Type: cd /tmp && git clone https://github.com/Cat5TV/nems-migrator
Create the backup config on your NEMS system. Type: cd /tmp/nems-migrator && ./backup.sh
Download the backup to your computer by opening it in your web browser. In your favorite web browser, simply add /backup/ to the end of your NEMS server address. Eg., http://10.0.0.5/backup/
Now that you have your backup.nems file, follow the instructions here to restore your configuration to a newer version of NEMS.
If you’ve deployed NEMS v1.1, you’ll notice there is a new NEMS Migrator tool. This allows you to export/backup your NEMS configuration (backup.nems) as well as import a previous backup (through the Restore option).
NEMS Migrator is also helpful when upgrading from previous versions of NEMS, saving you having to reconfigure your NEMS deployment just to get the latest features.
Important Note I am a firm believer in redundancy, and protecting your data. What I’d like you to do is, export your migration file, then install NEMS on a new MicroSD card. Then boot from that and restore your NEMS Migrator backup. Once you’ve confirmed everything worked well, you can deprecate the old one safely. However, if something went wrong, you can contact me to fix it for you, and continue running from the old SD card in the interim.
How to Restore a NEMS Migrator Backup
Requires NEMS 1.1+
Place your backup.nems file on a USB flash drive. You can access this directly from your web browser at http://NEMSIP/backup/ where NEMSIP is the IP address of the NEMS server you wish to backup.
Deploy the version of NEMS you wish to restore the backup to. Please heed my Important Note above.
Boot the new NEMS deployment and mount the USB flash drive.
Determine the location of backup.nems in relationship to your mountpoint. For example, if you mounted the USB flash drive on /mnt/flash you may determine the location to be /mnt/flash/backup.nems
Armed with that information, run the following commands:
The Nagios Remote Plugin Executor (NRPE) allows your Nagios Enterprise Monitoring Server to communicate with the Linux machines on your server to determine things like free disk space, CPU load, and detect possible issues that a simple ping can’t determine.
There are countless instructions online to download tar.gz files and install manually, or use a PPA to install via apt-get, but you’ll be surprised to note the needed packages are in fact already in your Debian (and by proxy, Ubuntu) repositories.
To install the needed NRPE client on Debian / Ubuntu / other Debian-based Linux operating systems:
apt-get install nagios-nrpe-server nagios-plugins
Don’t forget that you need to be root (Debian) or use sudo (Ubuntu).
Next, we just have to tell NRPE that it’s allowed to communicate with our Nagios server. On the client system, open the file /etc/nagios/nrpe.cfg
Find the line that reads: allowed_hosts=127.0.0.1
Now there are a few ways we can allow our server. First (and most obvious) is to add its IP address like this:
Where 192.168.0.5 is our Nagios/NEMS server.
Alternatively we can tell NRPE that it’s allowed to communicate with any local system:
Now, save the file and restart NRPE as follows:
service nagios-nrpe-server restart
And there we have it! Your Nagios/NEMS server should now be able to see your Linux machine.
Effective immediately under our new license, any commercial reuse of our material (eg., broadcasting on a commercial television channel, using our videos to generate revenue online, etc) must be approved in writing by myself.
Category5 TV remains entirely free for its viewers, no matter where they live in this big ol’ world of ours.
With The Drone Zone about to take flight, I wanted a way to rate the skill level required (or rather, recommended) for each drone we review. The purpose is so viewers can gauge during a review, from the DZSR (Drone Zone Skill Rating) which drone(s) they should be looking at first.
I’m open to suggestions, so please post your comments and this will become a bit of a living list, updated as needed. I will also maintain a static copy on The Drone Zone web site.
DZSR Level A
This drone is perfect for a beginner pilot. It’s easy to learn, has a price point that won’t hurt your wallet too badly if you crash it, and is a good drone to start with. As you take on drone flight, it’s best to start at DZSR Level A so you can learn the controls, practice, and get ready for the next level.
Mature pilots will also enjoy drones in this level as they’re nice to be able to carry around so you can fly wherever you are just for fun, without much consideration, packing or planning. Typical drones in this level: Nano quads.
DZSR Level B
If you’ve mastered drones at DZSR Level A, you’re ready to move on to DZSR Level B. Typical drones in this level: Toy camera quads, Entry level FPV.
DZSR Level C
If you’ve mastered drones at DZSR Levels A and B, you’re ready to move on to DZSR Level C. Typical Drones in this level: Video drones, drones with GPS, Racing drones.
DZSR Level D
If you’ve mastered drones at DZSR Levels A, B and C, you’re ready to move on to DZSR Level D. Typical Drones in this level: High-end/custom quads/hexacopters, DIY quadcopters.
Alternate method (which I had to use on the show since I didn’t have a pipe character… I’ve cleaned it up a bit since the live show so it is cleaner since it was an unexpected twist and I kinda made it seem more confusing than it should):
(Thanks to Steve for submitting this additional step)
Reboot one final time.
And there you have it! All the commands we used to get Plex Media Server installed on a Raspberry Pi 3 in a nice clean blog post 🙂
From there, we plugged in the USB flash drive (don’t do it! Use a proper external hard drive–this was only a demonstration) and after it mounted we used the following command to see its /dev assignment:
Since our drive was /dev/sda1, and of the filesystem type “fat32” this is what I did to make it work as the media library for Plex Media Server:
and add the following line:
/dev/sda1/mnt/library fatfs defaults00
I then created the mountpoint:
and made it so it can only be written to if mounted:
and finally, mounted the drive:
From there, I could easily add folders on my external drive to Plex using the web interface, which you’ll find on Port 32400 in the /web subfolder on your Pi.
To get my IP address, I brought up the terminal on the Pi and typed:
That showed the IP address of my Pi under “Ethernet”… 192.168.0.105
So to open Plex in my browser, from my computer I entered:
The IP address will most likely be different for yours, and you might even want to set it up as a static IP. Easiest way to do that would be to use your router’s DHCP reservations to hard-set the Pi to something outside your DHCP pool. For me, that’d be 192.168.0.5 or something like that, since the pool seemingly starts at 100.
Good luck, and if you have any questions or comments, please leave them below. Don’t forget, if this has helped you out, or if you just love supporting nice guys who wanna keep giving knowledge for free, please head over to our Patreon page, or throw a bit in the tip jar. Thanks!