Blog Just another tech site

2May/151

Foscam FI9903P Support For Synology Surveillance Station

Foscam Options

Add to (stop Surveillance Station First - within Package Center): /volume1/@appstore/SurveillanceStation/device_pack/camera_support/FOSCAM.conf

[FOSCAM*FI9903P]
{BasicSettings}
api = foscam-h264-v2
channel_list = 1
default_channel = 1
multi_streams = 2
default_rec_stream_h264 = 1
default_live_stream_h264 = 1
h264 = rtsp
motion = h264
motion_param = sensitivity
alarm_input = 1
alarm_output = 1
camera_parameters = yes
ntp_server = Surveillance Station,time.nist.gov,time.kriss.re.kr,time.windows.com,time.nuri.n
video_mirror = yes
video_flip = yes
exposure_control = 50,60,outdoor
default_exposure_control = 60
exposure_mode = auto,day,night,schedule
default_exposure_mode = auto
osd_timestamp = yes
osd_format = datetime,text
default_osd_format = datetime
default_username = admin
rtsp_protocol = auto,udp,tcp
default_rtsp_protocol = auto
extra_liveview_stream = mobile
{stream_1}
resolutions_h264 = 320x180,320x240,640x360,640x480,1280x720,1280x960,1920x1080
default_resolution_h264 = 1920x1080
fps_h264_[320x180,320x240,640x360,640x480,1280x720,1280x960] = 1-30
default_fps_h264_[320x180,320x240,640x360,640x480,1280x720,1280x960] = 10
bitrate_control_h264 = vbr,cbr
default_bitrate_control_h264 = vbr
default_vbr_quality_h264 = 5
cbr_list_h264 = 20,50,100,200,512,1024,2048,4096
{stream_2}
resolutions_h264 = 320x240,640x480
default_resolution_h264 = 320x240
fps_h264_[320x240,640x480] = 15
default_fps_h264_[320x240,640x480] = 15

Other profiles in surveillance station will work - but does not support 1080p (which has a much wider FOV).

Filed under: Software 1 Comment
11Apr/150

Zabbix User Parameters For Monitoring OSX Battery

Zabbix Graph
UserParameter=ChargeRemaining,system_profiler SPPowerDataType | grep "Charge Remaining" | awk '{print $4}'
UserParameter=FullyCharged,system_profiler SPPowerDataType | grep -m 1 "Fully Charged" | awk '{print $3}' | awk '{ gsub("No","0"); gsub("Yes","1"); print $1}'
UserParameter=ChargingStatus,system_profiler SPPowerDataType | grep -m 1 "Charging" | awk '{print $2}' | awk '{ gsub("No","0"); gsub("Yes","1"); print $1}'
UserParameter=FullChargeCapacity,system_profiler SPPowerDataType | grep "Full Charge Capacity" | awk '{print $5}'
UserParameter=CycleCount,system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}'
UserParameter=Condition,system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}'
UserParameter=Amperage,system_profiler SPPowerDataType | grep "Amperage" | awk '{print $3}'
UserParameter=Voltage,system_profiler SPPowerDataType | grep "Voltage" | awk '{print $3}'

Calculated item within zabbix for battery percentage:

last(ChargeRemaining)/last(FullChargeCapacity)*100

Filed under: Uncategorized No Comments
13Jul/140

Zabbix Proxy Dependencies

zabbix_logo_500x131

I experienced the following issues when trying to configure the zabbix proxy source. These were the packages that needed to be installed for it to compile.

zabbix-2.2.4# ./configure --prefix=/usr --enable-proxy --with-net-snmp --with-mysql --with-ssh2 --enable-ipv6 --with-libcurl --with-libxml2

checking for mysql_config... no
configure: error: MySQL library not found
# apt-get install libmysqlclient-dev

checking for xml2-config... no
configure: error: LIBXML2 library not found
# apt-get install libxml2-dev

configure: error: Not found Net-SNMP library
apt-get install libsnmp-dev
# apt-get install snmp

configure: error: SSH2 library not found
Built from source and installed.
http://www.libssh2.org/ 

E: Unable to locate package curl-dev
# apt-get install libcurl4-openssl-dev

configure: error: Not found Net-SNMP library
# sudo apt-get install libsnmp-dev

 

After these packages were installed it built successfully.

Filed under: Software No Comments
8May/140

Billion BiPAC 5200 RC SNMP OIDs

BimgBillion BiPAC 5200RC

 

It surprised me that such a cheap router supports SNMP out of the box. Below are a handful of OIDs that may be handy for others.

 

Hardware Description: 1.3.6.1.2.1.1.1.0

System Uptime: 1.3.6.1.2.1.1.3.0

LAN IP: 1.3.6.1.2.1.4.20.1.1.10.1.1.1

LAN MAC Address: 1.3.6.1.2.1.2.2.1.6.1

Interface 1 In Bytes: 1.3.6.1.2.1.2.2.1.10.1

Interface 1 Out Bytes: 1.3.6.1.2.1.2.2.1.16.1

WAN In Bytes: 1.3.6.1.2.1.2.2.1.10.2

WAN Out Bytes: 1.3.6.1.2.1.2.2.1.16.2

Filed under: Uncategorized No Comments
27Apr/140

Synology DSM 5.0 SNMP Interface Statistics OIDs

3Ece9xL

 

I was looking statistics to be pulled through SNMP for a Synology NAS and walked across the following OIDs. I imagine hardware with more than one interface, the numbering will just follow along logically. I will test this at a later date.

1.3.6.1.2.1.31.1.1.1.1.1 - Interface Name - Loopback
1.3.6.1.2.1.31.1.1.1.1.2 - Interface Name - Eth0

1.3.6.1.2.1.31.1.1.1.6.1 - Interface RX Total Bytes - Loopback
1.3.6.1.2.1.31.1.1.1.6.2 - Interface RX Total Bytes - Eth0

1.3.6.1.2.1.31.1.1.1.10.1 - Interface TX Total Bytes - Loopback
1.3.6.1.2.1.31.1.1.1.10.2 - Interface TX Total Bytes - Eth0

1.3.6.1.2.1.31.1.1.1.7.1 - Interface RX Total Packets - Loopback
1.3.6.1.2.1.31.1.1.1.7.2 - Interface RX Total Packets - Eth0

1.3.6.1.2.1.31.1.1.1.11.1 - Interface TX Total Packets - Loopback
1.3.6.1.2.1.31.1.1.1.11.2 - Interface TX Total Packets - Eth0

1.3.6.1.2.1.55.1.5.1.4.1 - Interface MTU - Loopback
1.3.6.1.2.1.55.1.5.1.4.2 - Interface MTU - Eth0

1.3.6.1.2.1.55.1.5.1.8.2 - Interface MAC Address - Eth0

Filed under: Uncategorized No Comments
5Oct/120

Cisco 2960s Ip Source Guard Port-Security Issue

IP Source Guard

Yesterday I had an issue where ip source guard with mac-address filtering was applied across a range of switches including 3560g's and 2960s'. The majority of switches functioned fine with the applied changes not affecting users. One issue appeared with a pair of 2960s switches which were running in series (one trunked to the next), where users could not obtain ip addresses from the DHCP server.

A different building with the same switches with the same IOS version and the same configuration were functioning correctly (as well as many others but on different VLANS.

I then took steps of restoring the previous working configuration and adding in the new configuration one line at a time. The changes that were being made was the implementation of dynamic arp inspection, port security and ip source guard.

If the command ip verify source was applied all was well (I checked this by shutting down ports, clearing the ip snooping binding table adding the command and then activating the ports again and checking if ip's were obtained.

The command ip verify source port-security was causing issues, which I originally thought that could have been caused by an option 82 issue, but it was allowed in the configuration and the DHCP server has had no issues with it in the past.

I then decided to upgrade the IOS version from 15.0(1)SE1 to 15.0(2)SE. This surprisingly fixed the issue and all was well with ip source guard once more.

Filed under: Cisco, Networking No Comments
1Oct/1213

Create new Windows Homegroup when there is an exisiting Homegroup on the network

Windows 7 Homegroup

I decided to try Homegroups between a windows 7 and Windows 8 to see if this really does facilitate easier sharing, while still being secure. I will leave my judgement for later as I only just configured this. I ran in to issues where a house mate had his own Homegroup on the existing network and I could not see an option to create one, only to join the existing one.

Steps to create a new one:

  1. Open up the Homegroup options within the control panel.
  2. Disable the network adapter / disconnect the Ethernet cable.
  3. Enable the network adapter and be prepared to create a new Homegroup quickly when the options appears.
  4. When the create new Homegroup option appears and quickly enter a password, as it will fail if it has enough time to find the exisiting Homegroup.
  5. Follow the prompts to set up and then insert your password on the other computers in the network like normal and it should automatically find the matching Homegroup.
Filed under: Software 13 Comments
15Sep/121

Asp.net: Update grid view after updating a linked form view

Grid View linked to Form View

A personal project I am currently working on is creating a asp.net database site, which will drive a organizations on-line membership management system.

One of the pages relies on a grid view at the top, which has selectable rows which a form view below relies on. The form view has a data key name of the selected row in the grid view.

When a row / field is updated in the form view, this is not instantly shown in the grid view, but instead will show after a page reload. I first presumed that auto post back would update the grid view, but as it is not the data view that is updated, the system does not automatically update it.

One way I have found to get around this pain, is to create a custom method which rebinds the data source to the grid view after the form view has been updated.

Under the formview object on the aspx page add the following (change the method name as required):

OnItemUpdated="FormView1_ItemUpdated"

Adding on item updated method

The related method in the backend code then needs to be created, add the following code:

protected void FormView1_ItemUpdated(object sender, EventArgs e)
{
this.GridView1.DataBind();
}

Since this is being called after the item has been updated, the datasource will have already been updated, therefore the new data simply needs to be pushed / bound to the grid view object.

Adding the required back-end code

After these changes my grid view now updates instantly without the need to refresh the page.

Filed under: Asp.Net, Software 1 Comment
3Aug/123

Using minicom to interface with serial devices on Linux

I came across a problem recently, I needed to configure a Cisco switch and all I had was a Ubuntu machine that had a serial port. Since then I've got a Cisco 2511, with octal cable, which is very handy when configuring many devices, but that is for another post.

I found a program called 'minicom' which is available as far as I'm aware in all the main repositories. This post is a brief explanation on how to find your serial port and setup / use minicom.

1. First of all lets start with finding the computers serial ports, make sure you have your device powered on and connected:

dmesg | grep tty

Listing Linux serial devices

This shows in my example that the physical serial port is at ttyS0, where as usb > serial converters will show as ttyUSB0

2. Time to open up minicom, I believe the later versions will allow running as an unprivileged user, but this will mean that you can not save configurations. Better to run as root if you have the option.

Start-up Minicom

Default page after starting Minicom

3. Checking the options available is very easy, to put minicom in to command mode control+a needs to be pressed, with a following 'z' to show the options. For example, control+a then x will close minicom.

Minicom Options

4. Now it is time to setup minicom, as you can see from the help page you need to use control+a then o (for options). Scroll down to "Serial port setup" and hit enter.

Minicom serial settings.

5. From there is is pretty straight forward to follow the prompts to change to your required settings. Typically Cisco networking equipment uses 9600 Bps/Par/Bits, "8-N-1", Yes to Hardware Control Flow and no to Software Control Flow. Also set your serial device to the one you found in the first step.

Minicom Cisco Settings

6. Now save your configuration for quicker access in the future, personally I save it as "Cisco".

Saving configuration

7. Now close minicom with control+a then x will prompt you the option to close the program or simply scroll to "Exit".

Resetting Minicom

8. If you saved a configuration within minicom, it can be used to open minicom directly in to those settings. For example, "minicom cisco".

Initialising Minicom

9. Everything should be ready for using your serial device.

Functioning Minicom

1Aug/1214

Cisco SG 200-08 Trunking

I've had a little struggle getting a Cisco SG 200-08 trunking with several vlans to a Cisco 3560G switch.

I'll quickly explain what was throwing me off for speed readers, but I will go in depth later on. On the proper Cisco switch the standard dot1q encapsulation and trunk mode needs to be used, this is similar to the SG 200-08 where the default 'trunk' port setting needs to be used. The only changes that need to be changed on the smart switch is to create the vlans before hand and put them as a member of the trunk port in the "Port VLAN Membership". This gave me strife because I am used to in 3560s' where all ports are allowed on a trunk from default where as they specifically need to be applied on the smart switches trunk ports.

How to setup a Cisco SG 200-08 with trunking and a non default management vlan:

  • First off I would start with providing the SG 200-08 a access port on a vlan that has DHCP access so the web interface can be access for configuration.

  • The device should now be access through the DHCP address, find this by looking up the server or doing an nmap scan and look for Cisco equipment.
  • Now create the VLANs you need and name them under the "Create VLAN tab".

  • The created VLAN/s now need to be added to the desired trunk port on the smart switch, this is done through "Port VLAN Membership". Simply select the trunk port, edit the details and select the VLAN that is to be allowed on the trunk, tick Membership and then click the arrow to move it in to the selected column.

  • The VLANs that are needed on the trunk should now be showing on the Port VLAN Membership page.

  • Access ports can now be configured, which is straight forward by changing the required ports to access ports and defining which VLAN is required, which is done through "Interface Settings". This won't actually work until we configure a trunk port on the other switch.

  • Depending on your native vlan settings, you may have to change the management vlan setting before changing the port on the other switch to a trunk. Just a reminder make sure the management vlan is a member of the trunk port. This can be done through the "IPv4 Interface".

  • The smart switch might be unconnectable if the management VLAN has been changed, therefore we need to enable a trunk port on the other switch to gain access again.

The switch should now be accessed through the IP entered in the management settings and trunking should be working correctly.

Just a note: A port setting called "General" can be used, which I believe will give you more options for Ingress Filtering and allowing tagging on that port, which would give you more options for VLAN compatible devices.

Filed under: Cisco, Networking 14 Comments