Nagios – Checking DHCP Leases with Ubiquiti EdgeRouter

Here’s a small script I threw together to check the number of DHCP leases on an Ubiquiti EdgeRouter. It’s made for use with Nagios.

It basically connects to the router via SSH, executes show dhcp leases and returns OK, WARNING, or CRITICAL depending on how many leases exist. See the comments for a little bit of documentation.

Download: check_er_dhcp_leases.sh

Continue reading Nagios – Checking DHCP Leases with Ubiquiti EdgeRouter

PVC Irrigation For Raised Garden Bed

Summer is upon us here in Denver and it’s time to start planting vegetables.

This year, Niki and I decided to try out a raised garden bed. I decided to go with a simple, 3 foot by 8 foot box, made out of 2″x8″ lumber. Below is the quick plan I drew up:

Raised Bed Plan

This is just a simple garden box that allows 8ish inches deep of soil. Lag screws hold the sides together, and the soil will keep the box from moving.

Next up, we needed an easy way to water the plants. Denver is in an arid climate, and we don’t want to waste water. The best thing to do is to get the water right to the roots of your plants. For that, we turn to a system developed in Utah.

Jeffrey Banks, out of Juab County in Utah, put together a wonderful document detailing a system they’ve been using. The system is inexpensive and very flexible.

Bed With PVC

The ingredients:

  • 7 feet of 3/4″ PVC
  • 21 feet of 1/2″ PVC
  • Six 3/4″x3/4″x1/2″ Tee fittings
  • 3/4″x1/2″ Elbow
  • Seven 1/2″ caps
  • Two 3/4″ PVC Street Elbows
  • 3/4″ Ball Valve
  • 3/4″ PVC to Hose fitting

The 3/4″ PVC runs along one of the long sides of the box. I cut it into seven 12″ sections. The 3/4″x1/2″ elbow is glued on the very end, with each section separated by the tee fittings. These fittings are glued. At the far end, a pair of street elbows are attached to a ball valve and a garden hose fitting.

Valve + Hose

The ball valve helps control the rate of flow. Eventually, as more beds are added, they will be interconnected and the ball valves can control where water goes as needed.

The short pipes are called laterals, and are made from the 1/2″ PVC. One pipe is usually sufficient to water two rows. I follows the directions from the Juab County system document, and drilled 1/16″ holes every 6 inches for rows beans and other stuff. For the squash, I grouped three holes together, 2 inches apart right next to the mounds. Since these are spread further apart, only one later is used for each row.Water Holes

Controlling the flow rate is essential. This is where the ball valve comes in really handy. I can fully open the spigot at the house, then use the ball valve to restrict the flow going into the pipes. As you can see above, the system is less drip and more trickle irrigation.

Time will tell how well the system works. Based on the results seen in Juab county though, I have a good feeling that it will work well.