The following is the technical information outline of NEMS (Nagios Enterprise Monitoring Server). Continue reading
Add A Drive to Linux and Encrypt It
Do you use an external hard drive, USB Flash drive or other removable media for your personal or company backups? Let’s encrypt it! Continue reading
I hosted an episode of The Pixel Shadow!
I’m so not a gamer, but over the weekend I got the fun chance to record an episode of The Pixel Shadow with me as host. Continue reading
Setting up NRPE on Windows for NEMS
Please Note: As of NEMS 1.2 NSClient++ is optional for monitoring of Windows computers (thanks to the addition of WMIC). If you’d like to use it, please follow the directions below.
- Grab the latest Windows client at https://www.nsclient.org/download/
- Install the client with the following settings:
- Select to install the “Generic mode” NSClient++.
- 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.
Category5 TV Network license changed.
For the past 9 years, all Category5 TV Network programming has been licensed under Creative Commons Attribution 2.5 Canada.
In an effort to ensure both our own protection from the commercial reuse of our freely available content as well as to protect our viewers from companies adding protection such as DRM to our content, we are now moving all Category5 TV Network programming, retroactively, to the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0).
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.
Enjoy the shows!
Robbie
Backup a Linux machine with LVM Snapshots and rdiff-backup
Here is the completed script I wrote on Episode 461. Make sure you check out the full episode for details on how to make this work for you.
#!/bin/sh /sbin/lvcreate -L10G -s -n lvm_snapshot /dev/ubuntu-mate-vg/root /bin/mount /dev/ubuntu-mate-vg/lvm_snapshot /mnt/snapshot /usr/bin/rdiff-backup -v5 --print-statistics \ --exclude /mnt/backup/ \ --include /mnt/snapshot/home/ \ --include /mnt/snapshot/etc/fstab \ --include /mnt/snapshot/var/log/ \ --exclude '**' \ / \ /mnt/backup/ /bin/umount /mnt/snapshot /sbin/lvremove -f /dev/ubuntu-mate-vg/lvm_snapshot
And of course, here is the episode:
Drone Zone Skill Rating
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.
Plex Media Server on a Raspberry Pi 3
I wanted to document the instructions shared on Episode 459 to supplement the episode.
On the show, Jeff and I demonstrated how to turn a Raspberry Pi 3 with Raspbian Jessie into a Plex Media Server, giving you the chance to stream your entire video and music library to all your devices.
I won’t get into the full details here, since this is only a supplement to give you some copy-and-paste instructions, but I’d encourage you to watch the video.
What You Need
- A Raspberry Pi 3 Micro Computer. Please consider purchasing it through our store to support what we do: https://cat5.tv/pi
- Raspbian Jessie – A free download from raspberrypi.org
- Obvious stuff like a good MicroSD card, Ethernet cable (preferred as opposed to wifi), keyboard and mouse… etc.
How to Do The Do
Updated February 7, 2018 due to some evolution of the process. These steps are more current than those used in the video (a new video will be coming soon).
- In terminal, upgrade your distro to the latest and greatest.
sudo apt update sudo apt upgrade sudo apt dist-upgrade
- Reboot the Pi.
sudo reboot
- Add the ability for apt to use https repositories. If you already have this, it’ll report as “already the current version” and you can move on.
sudo apt install apt-transport-https
- Add the Plex Media Server repository provided by Universität Leipzig.
echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list
- Add the GPG key for the repository.
This is the “easy” method (which didn’t work for us because my keyboard was in some weird mode with no pipe character):wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -
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):
wget -O /tmp/pms.key https://dev2day.de/pms/dev2day-pms.gpg.key sudo apt-key add /tmp/pms.key
- Update apt.
sudo apt update
- Install Plex Media Server.
sudo apt install plexmediaserver-installer
- Create the default config file so Plex knows what user to operate under.
echo "PLEX_MEDIA_SERVER_USER=pi" | sudo tee -a /etc/default/plexmediaserver sudo chown -R pi:pi /var/lib/plexmediaserver sudo service plexmediaserver restart
(Thanks to Steve for submitting this additional step)
- Reboot one final time.
sudo reboot
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 🙂
Optional: Use External Storage for Media
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:
sudo mount
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:
sudo nano /etc/fstab
and add the following line:
/dev/sda1 /mnt/library fatfs defaults 0 0
I then created the mountpoint:
sudo mkdir /mnt/library
and made it so it can only be written to if mounted:
sudo chattr +i /mnt/library
and finally, mounted the drive:
sudo mount -a
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:
sudo ifconfig
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:
192.168.0.105:32400/web
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!
NEMS Linux – Nagios Enterprise Monitoring Server for Raspberry Pi 3
NEMS Linux – Nagios Enterprise Monitoring Server for Raspberry Pi
Important Note: NEMS started as a small project here on my blog, but since has grown into a full-fledged distro! The blog therefore is here for historical purposes, but for the most current information, please visit the NEMS Linux web site: nemslinux.com
NEMS is a modern pre-configured, customized and ready-to-deploy Nagios Core image designed to run on the Raspberry Pi 3 micro computer. At its core it is a lightweight Debian Stretch deployment optimized for performance, reliability and ease of use.
NEMS is free to download, deploy, and use. Its development however is supported by its community of users. Please consider contributing if you can.
Please Note: NEMS is a very ambitious project, and I’m just one guy. Please consider throwing a little gift in my Tip Jar if you find NEMS saves you time or money. Thanks!
Support
[NEMS Documentation]
[NEMS Community Forum]
[NEMS User Comments]
Index
- What Is NEMS Linux and Nagios Core?
- Why Choose NEMS Linux?
- About NEMS
- NEMS’ Out Of The Box Experience
- System Requirements and Supported Platforms
- Instructions
- Buy The Needed Hardware
- Download
- Upgrade Instructions
- Changelog
NEMS 1.1 Featured on Category5 Technology TV
If you like NEMS, please donate: donate.category5.tv
The Out-Of-The-Box NEMS Experience:
- The first screen you see when connecting to an initiated NEMS 1.2 server.
- The quick statistics you see when logging into the NEMS terminal.
- The NEMS Monitorix screen shows you statistics about the performance of your NEMS server itself.
- NEMS NConf allows you to configure Nagios in a much more intuitive way.
- Nagios3 Tactical Overview and screens have been improved for NEMS.
- NagVis lets you see a graphical map of your network assets, including basic uptime information and current status.
- Check_MK offers a beautiful overview of your current and historical Nagios3 reports. A direct replacement for Nagios3 Core’s interface.
- The Host Info screen in Check_MK shows you the current status of your network.
- Another way to view the system uptime and other valuable information for your NEMS server itself.
- Historical graphs in RPi-Monitor let you know at a glance if your NEMS server is experiencing high load or temperatures and other important information.
- Webmin gives NEMS users a centralized interface for maintaining and monitoring your NEMS server.
- The notifications help you spot issues, and the built-in Software Package Updates feature of Webmin helps you keep your NEMS server up to date.
Raspberry Pi 3 are very affordable, and using our Micro SD image, you simply buy the device, “burn” the image to the Micro SD card, and boot it up.
Here’s our link to buy the device you’ll need, complete with the Micro SD card, a power adapter, a good solid case, and more: shop.category5.tv
Please buy it through that link, or let me know if you need a customized link to a different model. We get a small percentage of the sale, and it helps to make it possible to offer this as a free download.
Who Creates NEMS:
Robbie Ferguson is the host of Category5 Technology TV. He’s the kind of guy who when he figures stuff out, he likes to share it with others. That’s part of what makes his show so popular, but also what makes NEMS possible.
Support What I Do:
This project is a part of something much bigger than itself, and we’re all volunteers. Please see our Patreon page for information about our network.
– Please support us by simply purchasing your Raspberry Pi at https://cat5.tv/pi
– We have some support links on the NEMS menu, such as buying from Amazon using our partner link. Please use these every time you use those stores. A small percentage of your purchase will go toward our projects.
– Your donations are VERY MUCH appreciated – https://donate.category5.tv – Please consider how many hours (and hours) of work this project has saved you, and how much you’ll save on hardware and even electrical costs as you consider contributing
– Our network also has a Patreon page – Please consider becoming a patron – https://patreon.com/Category5
Convert Minecraft 1.8+ Skin to 1.6/1.7/Minetest Skin in PHP
As we build up #ThePixelShadow on Category5 TV, and introduce a creative Minetest server specifically for playing Minetest (the free Minecraft alternative), it became apparent that our users/viewers would like to be able to have their own custom skins.
We’re making it easy with a nice little interface to upload your own skins, but part of the process requires making a skin which is compatible with sdzen’s/PilzAdam’s player_textures mod … basically, these skins are Minecraft 1.6/1.7 skins… 64×32. Great Minecraft skin creator sites such as minecraftskins.com now generate Minecraft 1.8 skin files, which are 64×64.
The difference is essentially that the skins now support overlays (eg., removable headphones or glasses) and your left and right arms and legs can have different textures. Not the case with 1.6/1.7/Minetest… so we must convert the skin file to make it compatible.
Since we’re building a web interface to do this all automatically for you and place your player skin on our server automatically, I’m building the program in PHP. Since there are a lot of tutorials out there that simply instruct you to change your canvas size to 64×32 (which is wrong – you will lose your overlays!) I thought I would share my method with you in case it comes in handy.
And hey, it’s a fun exercise in PHP/GD anyways 🙂
<?php // Convert Minecraft 1.8+ skin to 1.7-/Minetest skin. // From Robbie Ferguson // www.baldnerd.com // Requires PHP, GD // By default outputs png to browser window AND saves a file for future use. Edit below to change behaviour. // v1.1 $input = './uploads/player_RobbieF.png'; // your 1.8 skin file $output = 'newskin.png'; // your new 1.7/Minetest skin file // Create image instances $src = imagecreatefrompng($input); $dest = imagecreatetruecolor(64, 32); // Make it transparent imagesavealpha($dest, true); $trans_colour = imagecolorallocatealpha($dest, 0, 0, 0, 127); imagefill($dest, 0, 0, $trans_colour); // Learn the dimensions of the input image $size = getimagesize($input); if ($size[0] == 64 && $size[1] == 64) { // it has Minecraft 1.8 skin dimensions - convert! // Copy - Syntax is Dest X,Y, Source X,Y, Width,Height // Head imagecopy($dest, $src, 0,0, 0,0, 32,16); // Head overlay imagecopy($dest, $src, 0,0, 32,0, 32,16); // Right leg, Body, Right Arm // The Leg and Arm become both left and right in 1.7- // We'll simply discard the left arm and leg since it's not used. // If you have an overlay on your left arm/leg but not right arm/leg, you might want to edit your skin since that will be discarded. imagecopy($dest, $src, 0,16, 0,16, 64,16); // Leg, Body and Arm overlay imagecopy($dest, $src, 0,16, 0,32, 64,16); } else { // already compatible. Just copy it. imagecopy($dest, $src, 0,0, 0,0, 64,32); } // Output to browser header('Content-Type: image/png'); imagepng($dest); // Save to a file imagepng($dest,$output,0); // 0-9. 0=faster, 9=smaller. // Free up memory imagedestroy($dest); imagedestroy($src); ?>
If you find a good use for it in your project, please comment below. If you really love what I do, please consider supporting my Patreon profile, or throw a little something in the tip jar.
Hope to see you on #ThePixelShadow Minetest server soon, custom skin and all!
-Robbie