Configure MS Windows 7 SNMP to work with SpeedFan

Hello m8s,

As you know in system administration field , the monitoring is essentials part daily stuff.

In Linux based OS , if you need to extract some numerical values from main-board sensors you will accomplished with no-more than….5 click..i mean commands.
And everything will just work as you expect…but there is also other side – some call it Windows ūüėÄ

As you know, running stuff on Windows sometimes becomes so fantastic journey (with point of no return ^_^), that you just may not able to remember where you start…and how the hell you made the deam thing to work ūüôā

In next..not so few steps i will show you how drawing thought SNMP numerical values from your main-board sensors.

I will use windows SNMP services + Speed Fan + all of my knowledge do guide you.

Installing and config snmp sensors with Windows 7

– Navigate to “Control Panel” -> “Programs and Features

– In left part select “Turn Windows features on or off

– Search in “Windows Features” for “Simple Network Managment Protocol (SNMP)” -> and put check . Now wait until install complete

– Navigate to services control pannel: Start Menu -> Run -> services.msc than search for “SNMP Services and righ click – Properties.

– Select “Agents” tab and type the correct values in Name and Location. For example: “Pavlin.Chervenkov” “Floor2” and then hit apply

– Select “Traps” tabs and type in “Community name” type “desktop” then hit apply.

– Select “Security” tab and add to “Accepted community names” the name from previous step – “desktop” and “Community rights” (READ ONLY)

– Add desire host to “Accept SNMP packets from these hosts” or use “Accept SNMP packets from any host

Then Apply and OK

– It is a MUST to stopl services and put it on Manual mode ! We shall start it later

– Check windows firewall !

 

Speedfan + snmp extension

–¬†Install¬† installspeedfan439.exe

– Install speedfan snmp extension http://deve.loping.net/projects/sfsnmp/downloads/

РStart speedfan with full path like this: Start > Run > C:\Program Files (x86)\SpeedFan\Injector.exe

 

Windows fixs

Control Panel¬†>¬†All Control Panel Items¬†>¬†User Accounts¬†>¬†Change user account control settings –¬†Never notify

Go to speedfan folder: C:\Program Files (x86)\SpeedFan\ 

right click on¬†injector.exe¬†>¬†Properties¬†>¬†Compatabillity¬†>¬†Set checkbox ON ¬†“Run this program as an administrator

Task Scheduler

We have to create two scheduler task to run everything smoothl.

1. Speedfan

Start > Run amd type: %windir%\system32\taskschd.msc /s

Action > Create Taks

General:

Name: speedfan

Configure for: Windows 7

Triggers > New:

Begin the task: At log on

Delay task for: 30 seconds

Actions > New:

Start a program:

“C:\Program Files (x86)\SpeedFan\injector.exe”

2. SNMP Task

Action > Create Taks

General:

Name: snmp

Configure for: Windows 7

Triggers > New:

Begin the task: At log on

Delay task for: 1minute

Actions > New:

Start a program:

D:\Install\snmpstart.bat”

This is content of snmpstart.bat

“net start snmp” <- Without the quotes !

Speedfan settings

 

Rum Smart fan from above path for the first time:

Start > Run: C:\Program Files (x86)\SpeedFan\injector.exe

Select “Configure” then “Options

+ “Start minimized”

+ “Minimize on close”

That is ! Now restart and pray.

I hope that you will enjoying doing this…:)

 

How to create software RAID 1 from existing installation on live system

If you have already installation which is installed on disk drive (/dev/sda), which is not part of RAID array and you have second disk drive (/dev/sdb) which is not in usage and you want to create software RAID from existing installation while OS is working, you can do following task to accomplish this:

1. Create RAID partitions on the second disk drive:
fdisk -l /dev/sdb

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        2432    19535008+  fd  Linux raid autodetect
/dev/sdb2            2433        2918     3903795   fd  Linux raid autodetect
/dev/sdb3            2919        3404     3903795   fd  Linux raid autodetect
/dev/sdb4            3405      121601   949417402+  fd  Linux raid autodetect
Create RAID 1 arrays using only the second disk and only one device per RAID partition.
mdadm --create /dev/md0 --level=1 --raid-devices=1 /dev/sdb1 --force
mdadm --create /dev/md1 --level=1 --raid-devices=1 /dev/sdb2 --force
mdadm --create /dev/md2 --level=1 --raid-devices=1 /dev/sdb3 --force
mdadm --create /dev/md3 --level=1 --raid-devices=1 /dev/sdb4 --force
Create swap and file systems:
mkfs.ext4 /dev/md0
mkfs.ext4 /dev/md2
mkfs.ext4 /dev/md3
mkswap /dev/md1
Mount and synchronize the existing data to RAID arrays:
mkdir /mnt/tmp
mkdir /mnt/var
mount /dev/md0 /mnt
mount /dev/md1 /mnt/tmp
mount /dev/md2 /mnt/var
mkdir /mnt/sys
mkdir /mnt/proc
rsync -av --exclude="/mnt" --exclude="/proc" --exclude="/sys" / /mnt/
rsync -av /var/ /mnt/var/
rsync -av /tmp /mnt/tmp/
Install grub to the new disk which implements RAID arrays:
grub-install /dev/sdb --root-directory=/mnt/
Update grub config files:
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
update-grub
exit
Describe the new mount devices in ‘/mnt/etc/fstab’:
~# blkid /dev/md0 
/dev/md0: UUID="64ea9000-3df6-4699-8c2e-df48f5c3835e" TYPE="ext4" 
~# blkid /dev/md1
/dev/md1: UUID="133dabc7-7957-462e-8b5e-1594ded31ec8" TYPE="swap" 
~# blkid /dev/md2
/dev/md2: UUID="a65dcd80-b8fc-49a6-835f-b06b930824b7" TYPE="ext4" 
~# blkid /dev/md3
/dev/md3: UUID="a7cbbd28-0617-4013-9870-714cf75334f4" TYPE="ext4"

cat /mnt/etc/fstab 
# /etc/fstab: static file system information.
#
# &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;
proc	/proc	proc	defaults	0	0
UUID=64ea9000-3df6-4699-8c2e-df48f5c3835e	/	ext4	defaults,errors=remount-ro	0	1
UUID=133dabc7-7957-462e-8b5e-1594ded31ec8	none	swap	sw	0	0
UUID=a65dcd80-b8fc-49a6-835f-b06b930824b7	/tmp	ext4	nodev,nosuid	0	2
UUID=a7cbbd28-0617-4013-9870-714cf75334f4	/var	ext4	defaults	0	2
Umount RAID partitions:
umount /mnt/proc
umount /mnt/sys
umount /mnt
Reboot the server and choose from the BIOS to boot from the second disk drive
After starting server again you should see already RAID arrays mounted devices:
mount
/dev/md0 on / type ext4 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/md2 on /tmp type ext4 (rw,nosuid,nodev)
/dev/md3 on /var type ext4 (rw)
We need to mirror partition table from the new RAID block device to the old (/first) disk drive:
sfdisk -d /dev/sdb | sfdisk /dev/sda
Grow RAID arrays size:
mdadm --grow --raid-devices=2 /dev/md0
mdadm --grow --raid-devices=2 /dev/md1
mdadm --grow --raid-devices=2 /dev/md2
mdadm --grow --raid-devices=2 /dev/md3
Add partitions from the first disk to RAID arrays:
mdadm --manage /dev/md0 --add /dev/sda1
mdadm --manage /dev/md1 --add /dev/sda2
mdadm --manage /dev/md2 --add /dev/sda3
mdadm --manage /dev/md3 --add /dev/sda4
Now the new disk arrays should start syncing:
cat /proc/mdstat 
Personalities : [multipath] [faulty] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [linear] 
md0 : active raid1 sda1[2] sdb1[0]
      19533912 blocks super 1.2 [2/2] [UU]

md1 : active raid1 sda2[2] sdb2[0]
      3902759 blocks super 1.2 [2/2] [UU]

md2 : active raid1 sda3[2] sdb3[0]
      3902759 blocks super 1.2 [2/1] [U_]
      	resync=DELAYED

md3 : active raid1 sda4[2] sdb4[0]
      949416242 blocks super 1.2 [2/1] [U_]
      [==================&gt;..]  recovery = 91.0% (864771072/949416242) finish=21.4min speed=65886K/sec
At the end we need to install grub on the first disk (/dev/sda) so if we can boot from any of disk:
grub-install --recheck /dev/sda

So this way you can create RAID 1 without almost any downtime. Just one server’s reboot and changing drive boot priority.

Configure Firefox to handle callto links in Ubuntu/Debian

Hi all ūüôā

in this post I will show you how to configure Mozilla Firefox to handle callto links. By default if you click on callto link in Firefox shows the following error:

The address wasn't understood

Firefox doesn't know how to open this address, because the protocol (callto) isn't associated with any program.

You might need to install other software to open this address.

These steps are tested on Ubuntu 12.04 LTS i386, Ubuntu 13.10 i386 and Debian Wheezy amd64.

1. Install SFLPhone Software for VOIP calls

apt-get install sflphone-gnome

2.¬†Start the app. First time you will see this screen. Just click ‚ÄúContinue‚ÄĚ:

SFLPhone

¬†We need to choose ‚ÄúRegister an existing SIP account‚ÄĚ on the next screen and click ‚ÄúContinue‚ÄĚ:

SFLPhone

¬†On the next screen we choose ‚ÄúSIP‚ÄĚ and click ‚ÄúContinue‚ÄĚ:

Here we need to fill our data:

Alias: Our name
Host name: Our SIP Server IP
User name: Your user or ID
Password: Your password

¬†After filling the required data, click ‚ÄúContinue‚ÄĚ:

¬†On the next screen just click ‚ÄúApply‚ÄĚ. We don’t need to setup anything here:

 Next you will see summary for your account.

 4. Save this script to /usr/bin/sflphone-handler

#!/bin/sh
#
# This script can be used as a callto: (or other) protocol handler in
# Mozilla Firefox-based browser.
# In Firefox use Preferences &gt; Applications and set the callto handler
# to this script.

# Test if a SFLphone client is already open, if not open a new one
# Opening a new client will start sflphoned if not already running
SFLPHONEC=`ps -A | grep sflphone-client`
if [ "$SFLPHONEC" = "" ]; then
    /usr/bin/sflphone-client-gnome&amp;
fi

# Check 1st argument (phone number)
if [ -z $1 ]; then
echo "Error: argument 1 (phone number) not provided."
    exit 1
fi

# Cleanup destination, keeping numbers only
TO="`echo $1 | sed -e 's/[^0123456789]//g'`"

# Generate call id.
CALLID=${RANDOM}$$

# Dbus placeCallFirstAccount method does not reach sflphoned if starting
# Should find another way to do this
sleep 1

dbus-send \
    --type="method_call" \
    --dest="org.sflphone.SFLphone" \
    "/org/sflphone/SFLphone/CallManager" \
    "org.sflphone.SFLphone.CallManager.placeCallFirstAccount" \
    string:"$CALLID" \
    string:"$TO"

exit 0

# EOF

 Or you can download it from:

https://github.com/LukeCarrier/sflphone/blob/master/tools/mozilla-telify-sflphone/sflphone-handler

5. Make this script executable:

chown root:root /usr/bin/sflphone-handler
chmod 755 /usr/bin/sflphone-handler

6. Add callto handler

sudo echo "x-scheme-handler/callto=sflphone.desktop" &gt;&gt; /usr/share/applications/defaults.list

7. Configure SFLPhone to accept parameters

nano /usr/share/applications/sflphone.desktop

and change

Exec=sflphone-client-gnome

to

Exec=sflphone-client-gnome %u

8. Configure Firefox

Open Firefox and click on callto link. First time you will see this screen:

¬†We need to click ‚ÄúChoose‚ÄĚ and navigate to /usr/bin/sflphone-handler.

Then check ‚ÄúRemember my choice for callto links‚ÄĚ and click ‚ÄúOK‚ÄĚ.

After a while SFLPhone application should start and automatically call the number from the link.