May 112015
 

I never noticed this before since I didn’t use Zabbix for production monitoring, but Zabbix out of the box does not have any alerts set up to tell you that an SNMP agent is unresponsive.
This isn’t an issue if you’re doing monitoring using the Zabbix Agent, or just monitoring server ups and downs, but when you’re using Zabbix to gather metrics such as CPU and Memory usage, this can become an issue.

The solution is to create a trigger for SNMP hosts to alert when Zabbix does not get any data for more than a certain amount of time.

Creating the trigger

I’ve chosen to create the trigger on the Template SNMP Generic template so that all SNMP devices will get this trigger.
To create the trigger, click on Configuration ==> Templates, and then find Template SNMP Generic. To the right, click on Triggers
Once the Triggers page has loaded, click on Create Trigger in the top right.
Give the trigger a name, and use the following Expression {Template SNMP Generic:sysUpTime.nodata(5m)}=1
Trigger Configuration
Optionally, give it a Description, and then set the Severity of the alert that you want to generate, and then click on Add.

The trigger should then apply to any devices that are linked to the Template SNMP Generic template.

Share
May 062015
 

box_1
I spotted these Plug and Play IP Cameras (IP900) at K-Mart for $30 a pop, so decided to grab a few to see what they are like.

A quick look at the box reveals the following about the camera –

  • Allows for Live Viewing and Remote Recording
  • Motion Detection and Tilt Rotation Capability
  • Two-way Audio, with a Built-in Microphone, Speaker, and Talk-back Function
  • View Footage Via Free Smartphone App
  • The Plug and Play IP Security Camera Aims to Reduce the Likelihood of Theft
  • Live Viewing and Remote Recording is a Convenient Way to Protect your Property and Loved Ones

When I opened the box, I found –

  • The Camera itself
  • A 5V 2A power supply with 100CM cable
  • A 90CM ethernet cable
  • An application CD
  • A mounting bracket with screws
  • Instruction booklets
    Contents

On first appearances, they look like FOSCAM FI8918W clones.

According to the Quick Start Booklet, the specifications of the camera are:

  • CMOS sensor with a 3.6mm Lens
  • 802.11 b/g/n WiFi
  • 355′ Pan Angle
  • 90′ Tilt Angle
  • IR Distance of up to 10 metres
  • MicroSD Card up to 32GB

Setup is very easy, just need to plug the power suppply into the camera and hook up the network cable from the camera to your router.
Once the camera has finished booting up, you can run the Search tool from the application CD to start setting up the camera.

When you start the Search Tool, it will scan your network for your cameras, and display them in the Cameras box.
As you can see, I currently have 3 cameras on my network. Clicking on one of them in the Cameras box will bring up the details in the Information box on the right.
IP Cam Search Tool

Clicking on Open on the bottom right will open up the web inteface for the Web Cam. The default username is admin with no password. After logging in, you will be presented with this page.
web1
If you want to use the IE controls, you’ll need to install the oPlayer file from the Application CD.

Compared to the “Server Push Mode” controls, The IE controls gives you a few more options to control the camera like Frame Rate (from 1-30 fps), Enabling/Disabling the OSD, and being able to take videos, pictures, control the IR LED and flashing green Signal Lamp on the front, and listen to what the camera is hearing. You can switch the resolution between 640×480 and 320×240 on this screen too.
Differences between controls

Clicking on the “Tools” button on the bottom brings up the control panel on the web interface where you can set up the date and time, change the admin username and password (which you should do right away!), set up the WiFi capability and network settings of the Cam, as well as the email alerting, and motion detection settings.
All of these settings can also be managed from the PC IE View application on the Application CD.
Web Control Panel

Remote access is provided through a “cloud” provider – hence the need to change the username and password.
Once you’ve downloaded the Android app p2pipc, you can use it to search for cameras by tapping the “Tap here to add camera”, and then tapping “Search”. As long as you’re on the same network as the camera, the app will display the cameras that are on the network and allow you to add them to the app. Once the cameras are added to the app, you will be able to access the cameras as long as the camera can connect to the internet.

The quality of the snapshots are fairly clear in both day light and low light. You could easily make a face out from ~7 meters, which should be fine for an indoor camera.

Conclusion?

These cameras are great value for $30, allowing for eyes and ears while you’re away from the home. The resolution is only 640×480 but there’s still enough detail to make out faces in the event of something happening. You can take photos on the mobile app if need be, and can also do motion recording and set the camera up to email you if there’s any motion occurring in view of the camera. Recording to SD card is also supported, however I have not had the chance to try that out yet. If there’s enough interest in this post, perhaps I will blog my results with this camera.

Share
May 042015
 

I’ve had some issues with some of my VMWare guests crashing for some odd reason.
The guests were my pfSense routers, so when they crashed, the house lost internet which was causing some issues as you could imagine!

Since I couldn’t work out why the guests kept crashing at first, I configured Zabbix to just reboot the virtual machines each time they went down so that the internet connectivity would be restored automatically. This meant that the emails that told me that my routers had crashed would actually be sent so that I would know that my internet had a hiccup, and for me to check to make sure any downloads I had running either finished properly, or that I had to redownload.

Zabbix has the ability to run remote commands on hosts via SSH, and my VMWare hosts had SSH enabled so I could run commands that I needed to reboot the hosts when the hosts went down.

Finding the VM

First thing I needed to do was to find the ID of the VM that I needed to reboot.
To get those, I needed to SSH onto my VM host and run the command vim-cmd vmsvc/getallvms | grep pfsense-2 which outputs this –
70 pfsense-2 [vmhost-500gb] pfsense-2/pfsense-2.vmx freebsd64Guest vmx-08 pfSense backup node
This command gave me the ID of 70 that I needed to use to reboot the VM from the command line.

Configuring the Zabbix Action

In order to run a command when a host went down, I created a new action to be run when a certain host goes down.
I used the following 3 conditions –
(A) Trigger value = PROBLEM
(B) Trigger = Template ICMP Ping: Template ICMP Ping is unavailable by ICMP
(C) Host = pfsense-2

This would make sure that the actions that run are only for the host that I have the ID for

In the Operations section of the action, I created a new step with the following settings –

Operation Type: Remote Command
Target : vmhost
Type : SSH
Username : root
Password : password
Port : 22
Commands : /bin/vim-cmd vmsvc/power.off 70 && /bin/vim-cmd vmsvc/power.on 70

The commands that I have used instructs VMWare to forcefully power off the VM with an ID of 70 – which in this case is my pfsense-2 guest, and then power it back on.

This was done on an ESX 5.1 host, but should work on anything newer as long as SSH is enabled.

Share