How-To: install NUT on Ubuntu 10.10 Maverick Meerkat

28 marzo 2011 1 commento
Ultima modifica di Spike il 31 marzo 2011 alle 20:30

In this How-to I will explain how to install and configure Network UPS Tools on Ubuntu 10.10 Maverick Meerkat.
I will configure it with my APC BackUPS RS 800.
Install the package

1
sudo apt-get install nut

Now we need to find out what driver we need to use.
Check it out at the Hardware Compatibility List.
In my case the driver is usbhid-ups.
Edit /etc/nut/ups.conf and add the following

1
2
3
[apc]
driver = usbhid-ups
port = auto

Start the driver

1
sudo upsdrvctl start

but you can get this error

1
2
3
4
5
Network UPS Tools – UPS driver controller 2.4.3
Network UPS Tools – Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Can’t chdir to /var/run/nut: No such file or directory
Driver failed to start (exit status=1)

Do the following to fix the problem

1
2
3
sudo mkdir /var/run/nut
sudo chown root:nut /var/run/nut
sudo chmod 770 /var/run/nut
sudo mkdir /var/run/nut
chown root:nut /var/run/nut
chmod 770 /var/run/nut

Try again with the command

1
sudo upsdrvctl start
sudo mkdir /var/run/nut
chown root:nut /var/run/nut
chmod 770 /var/run/nut
Network UPS Tools – UPS driver controller 2.4.3
Network UPS Tools – Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Can’t chdir to /var/run/nut: No such file or directory
Driver failed to start (exit status=1)

if it works, you should have an output like this

1
2
3
4
Network UPS Tools - UPS driver controller 2.4.3
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Using subdriver: APC HID 0.95

Now edit /etc/nut/upsd.conf and add the following lines

1
2
LISTEN 127.0.0.1 3493
LISTEN ::1 3493

This way, upsd will only listen to localhost port 3493/tcp.
Start the network data server

1
2
3
4
5
6
sudo upsd

Network UPS Tools upsd 2.4.3
listening on ::1 port 3493
listening on 127.0.0.1 port 3493
Connected to UPS [apc]: usbhid-ups-apc

Check the UPS status

1
2
3
sudo upsc apc@localhost ups.status

OL

OL means your system is running on line power.
Look at all of the status data which is being monitored

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
sudo upsc apc@localhost

battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2007/03/14
battery.runtime: 641
battery.runtime.low: 120
battery.temperature: 29.2
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: APC
device.model: Back-UPS BR  800
device.serial: QB0711130221
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.4.3
driver.version.data: APC HID 0.95
driver.version.internal: 0.34
input.sensitivity: high
input.transfer.reason: input voltage out of range
input.voltage: 232.0
input.voltage.nominal: 230
output.voltage: 230.0
output.voltage.nominal: 230.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 9.o2 .I
ups.firmware.aux: o2
ups.load: 20.0
ups.mfr: APC
ups.mfr.date: 2007/03/14
ups.model: Back-UPS BR  800
ups.productid: 0002
ups.serial: QB0711130221
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d

Now edit /etc/nut/upsd.users and add the following lines

1
2
3
4
5
6
[monuser]
        password = mypass
        actions = SET
        instcmds = ALL
        upsmon master
        # or upsmon slave

change the password field with a real password.
Reload upsd

1
upsd -c reload

Edit /etc/nut/upsmon.conf, create a monitor directive for upsmon

1
MONITOR apc@localhost 1 local_mon mypass master

Edit /etc/nut/nut.conf and change the mode to Standalone

1
MODE=standalone

Now you can start NUT with

1
sudo service nut start
echo “$*” | mailx -s “UPS Notice” test@example.com

 

 

If you want to enable e-mail notifications for UPS events, as suggested by Witwolf, edit again /etc/nut/upsmon.conf and add

1
2
3
4
5
6
7
8
9
10
11
12
NOTIFYCMD /usr/local/bin/nut-notify.sh

NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT  SYSLOG+WALL+EXEC
# NOTIFYFLAG FSD     SYSLOG+WALL
# NOTIFYFLAG COMMOK  SYSLOG+WALL
# NOTIFYFLAG COMMBAD SYSLOG+WALL
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC

Create the script /usr/local/bin/nut-notify.sh and paste the following

1
2
#!/bin/sh
echo "$@" | mail -s "NUT Notice" test@example.com

make it executable

1
sudo chmod +x /usr/local/bin/nut-notify.sh

 

 

Enjoy :)

 

 

SOURCES:
Network UPS Tools: User Manual – Configuration notes
Witwolf: My new APC Back-UPS Pro 900 arrived!

Categorie:Ubuntu Tag:

VMWare Server: guests power on hangs at 95%

28 marzo 2011 Nessun commento
Ultima modifica di Spike il 28 marzo 2011 alle 09:28

Host: Ubuntu Server 10.10 Maverick Meerkat
VMWare Server 2.0.2

If the host shut down unexpectedly, then it is possibile that you can’t start guests, hanging at 95% during startup process.
To solve, you need to:

  1. delete .lck file from the virtual machine’s folder
  2. delete file /etc/vmware/not_configured

Enjoy :)

SOURCE:
Zenware – VMware won’t boot after reboot: A general system error ocurred 95% boot and Stuff!

Categorie:VMWare Tag:

Office 2010 Professional Plus on Win 7 breaks Excel file associations

26 luglio 2010 Nessun commento
Ultima modifica di Spike il 21 gennaio 2011 alle 12:47

If after you have installed Microsoft Office 2010 Professional Plus on Microsoft Windows 7 64-bit, .xls and .xlsx are not associated anymore with Microsoft Excel, open regedit, go to
HKEY_CLASSES_ROOT
and delete both .xls and .xlsx folders. Then close the regedit. Now if select files with these extensions and you select Open with… you can now find Microsoft Excel.

Thanks to Waldo Nell’s voice for the solution.

SOURCE: Office 2010 Professional Plus on Win 7 breaks Excel file associations

Install nVidia drivers 179.48 beta on a Sony Vaio

17 giugno 2010 Nessun commento
Ultima modifica di Spike il 4 febbraio 2011 alle 16:03

This How-To explains how to install nvidia drivers 179.48 beta on a notebook Sony VGN-FE31M equipped with a nVidia GeForce Go 7600.
First of all download the official drivers from the official website.
Try to install them till you get the error. The installer has created a directory containing the drivers inside your C:, if you haven’t changed it during the installation process.
Now we have to take the hardware ID of our VGA.
Go to Start – right clic on Computer - Properties - Hardware tab – Device managerDisplay adapters – double clic on your VGA card – Details tab – select Device Instance ID
write down this code. Mine is

1
PCI\VEN_10DE&DEV_0398&SUBSYS_81EF104D&REV_A1\4&31B7BFB9&0&0008

Now open the following file

1
C:\NVIDIA\WinXP\179.48\IS\Display\NVAM.ini

the directory may differ depending on your OS. Under the

1
[NVIDIA.Mfg

section, put the following line

1
%NVIDIA_G73M.DEV_0398.1%  = nv4_A6JC,   PCI\VEN_10DE&DEV_0398&SUBSYS_81EF104D

and under the

1
; Localizable Strings

section, put

1
NVIDIA_G73M.DEV_0398.1  =  "NVIDIA GeForce Go 7600 (Sony VAIO VGN-FE31M)"

Now you can run

1
C:\NVIDIA\WinXP\179.48\IS\setup.exe

ENJOY :)

 

 

SOURCE: HOW TO: Modify and install Nvidia drivers for mobile graphics chipsets in Windows 7 when all else fails

Categorie:Microsoft Windows Tag:

vesa drivers on Ubuntu 10.04 Lucid Lynx

22 maggio 2010 Nessun commento
Ultima modifica di Spike il 4 febbraio 2011 alle 16:05

I have an ASRock 4Core1600-GLAN/M with an integrated video card, an Intel G31 northbridge, and I can’t use the intel drivers without a monitor (headless server) on Ubuntu 10.04 Lucid Lynx due to an X bug (Bug 14611 – X fails to start without display attached), so I need to use vesa drivers. First of all create che xorg.conf file with

1
sudo Xorg -configure

then edit it and at the Section “Device” replace

1
        Driver      "intel"

with

1
        Driver      "vesa"

Under Section “Screen” add

1
        DefaultDepth      24

and under the subsection

1
2
3
        SubSection "Display"
                Viewport   0 0
                Depth     24

add

1
                Modes     "1280x1024"

or write the screen resolution that you prefer.
 

Finally I got this xorg.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/X11/misc"
        FontPath     "/usr/share/fonts/X11/cyrillic"
        FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
        FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
        FontPath     "/usr/share/fonts/X11/Type1"
        FontPath     "/usr/share/fonts/X11/100dpi"
        FontPath     "/usr/share/fonts/X11/75dpi"
        FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
        FontPath     "built-ins"
EndSection

Section "Module"
        Load  "glx"
        Load  "dri2"
        Load  "dri"
        Load  "dbe"
        Load  "record"
        Load  "extmod"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/input/mice"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
        HorizSync    31-101
        VertRefresh  60-160
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"                   # [<bool>]
        #Option     "SWcursor"                  # [<bool>]
        #Option     "ColorKey"                  # <i>
        #Option     "CacheLines"                # <i>
        #Option     "Dac6Bit"                   # [<bool>]
        #Option     "DRI"                       # [<bool>]
        #Option     "NoDDC"                     # [<bool>]
        #Option     "ShowCache"                 # [<bool>]
        #Option     "XvMCSurfaces"              # <i>
        #Option     "PageFlip"                  # [<bool>]
        Identifier  "Card0"
        # Driver      "intel"
        Driver      "vesa"
        VendorName  "Intel Corporation"
        BoardName   "82G33/G31 Express Integrated Graphics Controller"
        BusID       "PCI:0:2:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultDepth      24
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes     "1280x1024"
        EndSubSection
EndSection

If you try to start X server now, I’ll get this error

1
(EE) VESA: Kernel modesetting driver in use, refusing to load

You need to edit grub

1
sudo nano / etc/default/grub

and edit the GRUB_CMDLINE_LINUX_DEFAULT this way

1
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

As said in the top of the file, update grub

1
sudo update-grub

Restart the system and enjoy :)

 

 

SOURCE:
xorg.conf con intel 945

 

Categorie:Ubuntu Tag: , ,