Archivio

Archivio per la categoria ‘Ubuntu’

How-To: install and configure SNMP v3 on CentOS 6.2

20 febbraio 2012 Nessun commento

Install SNMP

1
yum install net-snmp-utils net-snmp-libs

Create a new user using the net-snmp-create-v3-user command

1
2
3
Usage:
net-snmp-create-v3-user [-ro] [-A authpass] [-X privpass]
[-a MD5|SHA] [-x DES|AES] [username]
1
2
3
4
5
[root@centos-mail ~]# net-snmp-create-v3-user -ro -A auth_password -X privacy_password -a SHA -x AES cactiuser
adding the following line to /var/lib/net-snmp/snmpd.conf:
   createUser cactiuser SHA "auth_password" AES privacy_password
adding the following line to /etc/snmp/snmpd.conf:
   rouser cactiuser

Test it with

1
snmpwalk -v 3 -u cactiuser -a SHA -A "auth_password" -l authPriv -x AES -X "privacy_password" localhost

Change auth_password and privacy_password with your passwords.

Enjoy :)

 

 

SOURCE: SNMP v3 Setup Guide by Digital Servitude

Categorie:Ubuntu Tag:

How-To: set master monitor on a dual head configuration on Ubuntu 11.04

5 settembre 2011 Nessun commento

OS: Ubuntu 11.04 (Natty Narwhal)
Video Card: Intel Integrated Graphic Card
Video output: 1 DVI, 1 VGA

The system “Monitors” application let you set the disposition of the two monitors, which is left and which is right, but it doesn’t let you decide which is the master (or 0 and 1).
By default, the system set the VGA monitor as master but I want it to be the slave and configure the DVI monitor to be the primary.

Run xrandr to view how monitors are named and what are used:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
massimo@bebop:~$ xrandr
Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 8192 x 8192
VGA1 connected 1280x1024+1280+0 (normal left inverted right x axis y axis) 338mm x 270mm
   1280x1024      60.0*+   75.0
   1152x864       75.0
   1024x768       75.1     70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   640x480        72.8     75.0     66.7     60.0
   720x400        70.1
HDMI1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 337mm x 270mm
   1280x1024      60.0*+   75.0
   1152x864       75.0
   1024x768       75.1     70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   640x480        72.8     75.0     66.7     60.0
   720x400        70.1
DP1 disconnected (normal left inverted right x axis y axis)

In my case, the DVI connection is identified as HDMI1.
Now shut off the VGA monitor

1
xrandr --output VGA1 --off

Shut off the DVI

1
xrandr --output HDMI1 --off

WARNING: doing this will disable both of your monitors!
Keep the terminal on top and write next command blindly.

Set the HDMI1 interface as primary

1
xrandr --output HDMI1 --auto --primary

Enable the secondary and put it to the right of the primary

1
xrandr --output VGA1 --auto --right-of HDMI1

Enjoy :)

 

 

SOURCE: ubuntuforums.org – [ubuntu] Changing master monitor in dual set-up

Categorie:Ubuntu Tag:

Change vMA keyboard layout

4 giugno 2011 Nessun commento

Edit /etc/sysconfig/keyboard

1
sudo vi /etc/sysconfig/keyboard

replace KEYTABLE to your language set (in my case italian)

1
KEYTABLE="it"

Reboot vMA.

 

Enjoy :)

Categorie:Ubuntu Tag:

How-To: install NUT on Ubuntu 10.10 Maverick Meerkat

28 marzo 2011 Nessun commento

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:

vesa drivers on Ubuntu 10.04 Lucid Lynx

22 maggio 2010 Nessun commento

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: , ,