tag:blogger.com,1999:blog-85499531434122636202023-11-15T07:38:25.241-08:00vikjon's Linux and Media Center Howtovikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.comBlogger74125tag:blogger.com,1999:blog-8549953143412263620.post-48863912268833009442010-10-30T00:47:00.001-07:002010-10-30T00:52:33.540-07:00PXE installer & LivePXEI have done some work on network booting (PXE) and pxe installation.<br /><br />I have created a live cd. The first version boots clonzilla, gparted and installs lucid mini cd. On the server version I can boot ubuntu desktop Live, but that does not work on the LIVEPXE cd (NFS does not work on the cd for the moment). <br /><br />The advantage of my solution is that I use a dchp proxy wich means it coexists with existing dhcp without any changes.<br /><br />Download it at:<br />https://sourceforge.net/projects/qfpxeinstaller/<br /><br />This is how to config it yourself.<br />http://ubuntuforums.org/showthread.php?t=1606910vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-45549687039902296612010-10-23T09:53:00.000-07:002010-10-23T09:58:50.537-07:00dchpProxyThis is a very crude setup of dhcpProxy with dnsmasq.<br />With this setup it has to be on the same server as tftp (I think).<br />I will fix that and also change the config file from ltsp which is not relevent since I use it for a PXE install server.<br /><br />I will also make a start script that handle dynamic subnet.<br /><br /><br />--------------------------------------------<br />Installing dnsmasq<br />-----------------------------------------------<br />https://help.ubuntu.com/community/UbuntuLTSP/ProxyDHCP<br /><br />sudo apt-get install dnsmasq<br /><br />sudo nano /etc/dnsmasq.d/ltsp.conf<br />add:<br /><br /><blockquote>####################################################################<br /># Copied from https://help.ubuntu.com/community/UbuntuLTSP/ProxyDHCP<br /># Modified by vikjon0 2010-10-22 for PXE install server<br />#####################################################################<br /># Sample configuration for dnsmasq to function as a proxyDHCP server,<br /># enabling PXE clients to boot when an external, unmodifiable DHCP<br /># server is present.<br /># The main dnsmasq configuration is in /etc/dnsmasq.conf;<br /># the contents of this script are added to the main configuration.<br /># You may modify the file to suit your needs.<br /><br /># Don't function as a DNS server:<br />port=0<br /><br /># Log lots of extra information about DHCP transactions.<br />log-dhcp<br /><br /># Dnsmasq can also function as a TFTP server. You may uninstall<br /># tftpd-hpa if you like, and uncomment the next line:<br />#enable-tftp<br /><br /># Set the root directory for files available via FTP.<br />tftp-root=/var/lib/tftpboot<br /><br /># The boot filename.<br />dhcp-boot=/var/lib/tftpboot/pxelinux.0<br /><br /># rootpath option, for NFS<br />dhcp-option=17,/var/www/PXE<br /><br /># kill multicast<br />dhcp-option=vendor:PXEClient,6,2b<br /><br /># Disable re-use of the DHCP servername and filename fields as extra<br /># option space. That's to avoid confusing some old or broken DHCP clients.<br />dhcp-no-override<br /><br /># PXE menu<br />pxe-prompt="Press F8 for boot menu", 3<br /><br /># The known types are x86PC, PC98, IA64_EFI, Alpha, Arc_x86,<br /># Intel_Lean_Client, IA32_EFI, BC_EFI, Xscale_EFI and X86-64_EFI<br />pxe-service=X86PC, "Boot from network", pxelinux<br /><br /># A boot service type of 0 is special, and will abort the<br /># net boot procedure and continue booting from local media.<br />pxe-service=X86PC, "Boot from local hard disk", 0<br /><br /># If an integer boot service type, rather than a basename is given, then the<br /># PXE client will search for a suitable boot service for that type on the<br /># network. This search may be done by multicast or broadcast, or direct to a<br /># server if its IP address is provided.<br />#pxe-service=x86PC, "Install windows from RIS server", 1<br /><br /># This range(s) is for the public interface, where dnsmasq functions<br /># as a proxy DHCP server providing boot information but no IP leases.<br /># Any ip in the subnet will do, so you may just put your server NIC ip here.<br />dhcp-range=192.168.0.130,proxy<br /><br /># This range(s) is for the private network on 2-NIC servers,<br /># where dnsmasq functions as a normal DHCP server, providing IP leases.<br />#dhcp-range=192.168.0.20,192.168.0.250,8h<br /><br /># For static client IPs, and only for the private subnets,<br /># you may put entries like this:<br />#dhcp-host=00:20:e0:3b:13:af,10.160.31.111,client111,infinite</blockquote>vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-1811326271704474032010-04-08T23:24:00.000-07:002010-04-08T23:26:12.294-07:00Bug in Karmic network-managerWhen making connection available for all users this just causes the connection to disappear<br /><br />Workaround:<br />set "managed=true" in [ifupdown] section in /etc/NetworkManager/nm-system-settings.conf<br /><br />https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/405413vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-83389718484409511472010-03-21T04:39:00.000-07:002010-03-21T04:40:44.423-07:00Howto downgrade ubuntu 9.10 karmic to legacy grubMy Asrock ION 330 hangs for a minute in the boot sequence with grub2.<br />Lets downgrade to Legacy.<br /><br /><br />sudo apt-get purge grub2 grub-pc<br />sudo rm /boot/grub/*<br /><br />sudo apt-get install grub<br /><br />sudo update-grub <br /><br />sudo fdisk -l<br /><br />sudo grub-install /dev/sdX <br /><br />echo "grub hold" | sudo dpkg --set-selectionsvikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-53553001443596241232010-03-20T01:40:00.000-07:002010-04-04T14:58:21.126-07:00Howto get automount and stuff working in 9.10 Karmic without gdmWhen running the gnome desktop without gdm e.g. by startx things does not work as expected. E.g. if a usb disk is plugged in it is not mounted and the err "not authorized" is displayed.<br /><br />I think the correct solution may be to include ck-launch-session in startx but I have not been able do do this. I still dont really understand exactly how the ubuntu startup scripts works.<br /><br />EDIT: please note that this does not fix usb automount in xbmc.<br />The problem can instead be fixed by:<br /><br />sudo apt-get install policykit-1 devicekit-power<br /><br />sudo nano /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla<br />add:<br /><br />[Actions for xbmc user]<br />Identity=unix-user:xbmc<br />Action=org.freedesktop.devicekit.disks.*;org.freedesktop.devicekit.power.*;org.freedesktop.consolekit.system.*;org.freedesktop.hal.storage.mount-removable;org.freedesktop.hal.device.volume<br />ResultActive=yes<br />ResultAny=auth_admin<br />ResultInactive=yesvikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-27607714107676147622010-03-16T07:37:00.000-07:002010-04-04T14:57:07.786-07:00xbmc 9.11 usb does not automount after gnome-core is installedI have this very annoying probklem that I have not been able to solve. when I install gnome-core usb disks does not mount anymore. I get "not authorized".<br />Generally if I use gdm it works but if I use xbmc or startx it does not work.<br /><br />I think the problem could be that the policykit is upgraded to polictkit-1 and any settings that are done for xbmc does not work anymore.<br /><br />I have now found this: EDIT: This does not fix the usb mount problem. It fixes some other permission problems though. I have given up on xbmc and gnome for the moment. I use lxde with xfce and kde components instead.<br />http://forum.xbmc.org/showthread.php?t=70394<br /><br />--------------------------<br />(sudo apt-get install policykit-1 devicekit-power)<br /><br />sudo nano /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla<br />add:<br /><br />[Actions for xbmc user]<br />Identity=unix-user:xbmc<br />Action=org.freedesktop.devicekit.disks.*;org.freedesktop.devicekit.power.*;org.freedesktop.consolekit.system.*;org.freedesktop.hal.storage.mount-removable;org.freedesktop.hal.device.volume<br />ResultActive=yes<br />ResultAny=auth_admin<br />ResultInactive=yesvikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com4tag:blogger.com,1999:blog-8549953143412263620.post-13691114208253548942010-02-14T08:45:00.000-08:002010-03-02T05:18:43.220-08:00NSClient++ external vbs script to check MSSQL jobsEdit: New fixed version<br /><br />This script for NSClient++ checks if there is any failed jobs in MS SQL server. The database connection data is stored in a UDL file.<br /><br />External script alias in nsclient:<br />check_mssql_jobs=cscript.exe //T:30 //NoLogo scripts\check_mssql_jobs.vbs /MaxWarn:0 /MaxCrit:1 /truncate:900<br /><br />Nagios command:<br />define service{<br /> use generic-service<br /> host_name SEHQFVD03<br /> service_description MSSQL jobs<br /> check_command check_nrpe_check_mssql_jobs<br /> high_flap_threshold 35.0<br /> low_flap_threshold 30.0<br /> notification_options w,u,c,r,f<br />}<br /><br /><br />Script:<br />'########################################################<br />'# Check MSSQL jobs over UDL TEST v0.0.0.4 <br />'# VIKJON0 2010-02-13 <br />'# VIKJON0 2010-03-02 Only look at latest time job was run <br />'#########################################################<br /><br />Option Explicit <br />Dim strConnection, conn, rs, strSQL <br />Dim objConn <br />Dim connStr<br />Dim foundTXT, returnTXT, perfTXT<br />Dim errLevel, errLevelTXT<br />Dim MaxWarn, MaxCrit, numberOfRows, truncate<br />Dim wshArgs<br /><br />'--Set working directory<br />Dim WshShell <br />Set WshShell = WScript.CreateObject("WScript.Shell") <br />'WScript.Echo WshShell.CurrentDirectory <br />WshShell.CurrentDirectory = "C:\Program Files\NSClient++\scripts" <br /><br />'--Get command line arguments-- /MaxWarn:Y /MaxCrit:Z /truncate:x<br />Set wshArgs = wscript.arguments<br /><br />if wshArgs.Named.exists("MaxWarn") then<br /> MaxWarn = cint(wshArgs.named.item("MaxWarn"))<br />else<br /> MaxWarn = 0<br />end if<br /><br />if wshArgs.Named.exists("MaxCrit") then<br /> MaxCrit = cint(wshArgs.named.item("MaxCrit"))<br />else<br /> MaxCrit = 0<br />end if<br />if wshArgs.Named.exists("truncate") then<br /> truncate = cint(wshArgs.named.item("truncate"))<br />else<br /> truncate = 0<br />end if<br /><br />'--Run db query-----------------------<br />strConnection = "File Name=myUDL.udl; "<br />Set conn = CreateObject("ADODB.Connection")<br />conn.Open strConnection<br /><br />Set rs = CreateObject("ADODB.recordset")<br /><br />'Check only category = 3 for maintence jobs <br />'------------------------------------------------------<br /><br />strSQL = "SELECT name, message,category_id FROM msdb.dbo.sysjobs AS J LEFT OUTER JOIN msdb.dbo.sysjobhistory AS H ON J.job_id = H.job_id " &_<br />"WHERE enabled = 1 AND run_status != 1 AND step_id = 0 " &_<br />"AND (cast(run_date as varchar) + RIGHT('00' + cast(run_time as varchar),6)) = " &_<br />"(select max(cast(run_date as varchar) + RIGHT('00' + cast(run_time as varchar),6)) " &_<br />"FROM msdb.dbo.sysjobhistory AS H2 where H2.job_id = H.job_id AND H2.step_id = 0 " &_<br />")order by name"<br /><br />'----------------------------------------------<br /><br /><br />rs.open strSQL, conn, 3,3<br />numberOfRows = rs.recordcount<br /><br />foundTXT = ""<br />if numberOfRows = 0 then<br /> foundTXT = "check_db OK"<br />else<br /> rs.MoveFirst<br /> WHILE NOT rs.EOF<br /> foundTXT = foundTXT & rs("name") & "#"<br /> rs.MoveNext<br /> wend<br />end if<br /><br /><br />'--Ceck result and build return data<br />If truncate > 0 then<br /> foundTXT = left(foundTXT,truncate)<br />end if<br /><br />errLevel = 0<br />errLevelTXT = ""<br />if not MaxCrit = 0 AND numberOfRows >= MaxCrit then<br /> errLevel = 2<br /> errLevelTXT = ", found errors: " & numberOfRows & " > critical"<br />else <br /> if not MaxWarn = 0 AND numberOfRows >= MaxWarn then<br /> errLevel = 1<br /> errLevelTXT = ", found errors: " & numberOfRows & " > warning"<br /> end if<br />end if<br /><br />perfTXT = "|'found errors'=" & numberOfRows &";" & MaxWarn & ";" & MaxCrit & ";" <br />returnTXT = foundTXT & errLevelTXT & perfTXT<br />'msgbox returnTXT<br /><br />'--Close and exit<br /><br />rs.Close<br />Set rs = Nothing<br />conn.Close<br />Set conn = Nothing<br /><br />Wscript.StdOut.WriteLine ReturnTXT<br />WScript.Quit(errLevel)vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-29445978266524378292010-02-12T09:56:00.000-08:002010-02-12T10:01:29.950-08:00Substitute nagios as sender for notifications emailIf you want to replace the sender in the nagios email notifications add this to the end of the email command:<br />-a "From: mememe@company.com"<br /><br />($HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ -a "From: mememe@company.com")vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-9444971752054022362010-02-07T02:16:00.000-08:002010-02-07T02:32:15.157-08:00Monitor MS SQL with ceck_mssql!I had major problem getting the user authentication to work. As soon as I removed freetds it started to work...<br /><br />One way is to run queries from Nagios directly to the MSSQL server with this plugin:<br />http://exchange.nagios.org/directory/Plugins/Databases/SQLServer/check_mssql/details<br /><br />This is a risk since user / pwd has to be stored on the Nagios server and also sent over network. It is perhaps better to create vbs scripts that reads the database and access it over nsclient++.<br /><br />1) Install check_mssql<br />download the script from http://exchange.nagios.org/directory/Plugins/Databases/SQLServer/check_mssql/details<br />Copy it to libexec<br />sudo cp check_mssql /usr/local/nagios/libexec<br />*Change owner to nagios and make it executable<br /><br />2) Install php support in ubuntu<br />sudo apt-get install php5 php5-mysql php5-cli libapache2-mod-php5 php5-sybase<br />(I dont see why php5-mysql should be installed, but installed by mistake and if removed it stops working. Will test without next scratch install)<br /><br />3) Test from commandline<br />/usr/local/nagios/libexec/check_mssql -H 192.168.0.100 -U myuser -P mypwd<br /><br />x) from doc<br />sec<br />Hide Sensitive Information With $USERn$ Macros. The CGIs read the main config file and object config file(s), so you don't want to keep any sensitive information (usernames, passwords, etc) in there. If you need to specify a username and/or password in a command definition use a $USERn$ macro to hide it. $USERn$ macros are defined in one or more resource files. The CGIs will not attempt to read the contents of resource files, so you can set more restrictive permissions (600 or 660) on them. See the sample resource.cfg file in the base of the Nagios distribution for an example of how to define $USERn$ macros.vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-23958434292730371892010-02-06T07:11:00.000-08:002010-02-07T09:58:07.523-08:00More Nagios service definitions for windows<span style="font-weight:bold;">Monitor disks with NSClient</span><br />define command {<br /> command_name check_nrpe_DriveSpace<br /> command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a MinWarn=$ARG1$ MinCrit=$ARG3$ CheckAll $ARG3$<br /># ARG3 : FilterType=FIXED FilterType=REMOTE<br />}<br /><br />define service{<br /> use generic-service<br /> host_name myhost<br /> service_description Disk space <br /> #Warning,Critical,Filter<br /> check_command check_nrpe_DriveSpace!15%!10%!FilterType=FIXED<br /> high_flap_threshold 35.0<br /> low_flap_threshold 30.0<br /> notification_options w,u,c,r,f<br />}<br /><br />Check all fixed disks NSClient command line:<br />CheckDriveSize MinWarn=15% MinCrit=10% CheckAll FilterType=FIXED<br />Nagios command line:<br />sudo /usr/local/nagios/libexec/check_nrpe -H 192.168.100 -c CheckDriveSize -a MinWarn=50% MinCrit=25% CheckAll FilterType=FIXED<br /><br /><span style="font-weight:bold;">Montor services with NSClient<br /></span><br />nsclient commandline:<br />CheckServiceState CheckAll exclude=wampmysqld exclude=ccmsetup exclude=tcsd_win32.exe<br /><br />define command {<br /> command_name check_nrpe_AutoStartedServices<br /> command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a CheckAll $ARG1$<br /># ARG1 : exclude=ccmsetup exclude=test<br />}<br /><br />define service{<br /> use generic-service<br /> host_name SELANSFVD99<br /> service_description Autostarted Services<br /> # ARG1 : exclude=ccmsetup exclude=test<br /> check_command check_nrpe_AutoStartedServices!exclude=SysmonLog<br /> high_flap_threshold 35.0<br /> low_flap_threshold 30.0<br /> notification_options w,u,c,r,f<br />}vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-7505556414884880672010-02-05T07:58:00.000-08:002010-02-07T02:14:59.884-08:00Nagios configuring notifications0) <br />mailx must be installed and configured. (see prev post)<br />The commands also have to be amended:<br />###<br />Edit the Nagios email notification commands found in /usr/local/nagios/etc/objects/commands.cfg and change any '/bin/mail' references to '/usr/bin/mail'. Once you do that you'll need to restart Nagios to make the configuration changes live.<br /><br />sudo /etc/init.d/nagios restart<br /><br />1)<br />Contacts and groups are configured in contact.cfg. By default email are sent to admin. Default member is nagiosadmin. Nagios admin email address (your's) are set in the same file.<br /><br />2)States and flapping<br />When a problem appear it first goes to "soft state" and after 3 checks (3/3) it change to "hard state" and the notification is sent.<br /><br />If the hard state change on and off too often the service is determined to be "flapping". To change the flapping thresholds add these lines to the service definition:<br /> high_flap_threshold 35.0<br /> low_flap_threshold 30.0<br /><br />When the service is flapping no notifications is sent until it stops flapping.<br />If we want to have a notification when flapping start add this line to service definition:<br /> notification_options w,u,c,r,f<br />(f for flapping)vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-45712145716483518902010-02-05T02:40:00.000-08:002010-02-08T00:51:31.280-08:00Monitor windows server with Nagios - Configure nrpeTo do some more advance application monitoring we need to configure nrpe between nagios and nsclient++.<br />The first thing we need to monitor is that no files get stuck in import or export folders. (Next problem will be to monitor MS SQL servers, will probably have to find another plug-in for this.<br /><br />Reference:<br />http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf<br /><br />1) Config nsclient<br />uncomment<br />NRPEListener.dll<br />allow_arguments=1<br />use_ssl=1<br /><br />It is a risk to allow arguments. The alternative I think is to create local commands/ alias on the remote machine.<br /><br />Test in nsclient command line (start nsclient /test)<br />CheckFile2 path=c:\test pattern=*.txt MaxCrit=1 filter+written=gt:10m<br />(checks for files older than 10minutes in c:\test)<br /><br />2) Install nrpe plug-in in Nagios(local server)<br />The NRPE addon consists of two pieces:<br />– The check_nrpe plugin, which resides on the local monitoring machine<br />– The NRPE daemon, which runs on the remote Linux/Unix machine<br /><br />To monitor a windows machine we need the plugin. The demaon will be NSClient on windows. If we want to test nrpe on the local machine we should also install the daemon locally.<br /><br />a) Install check_nrpe plugin<br />sudo apt-get install libssl-dev <br /><br />sudo -s<br /><br />mkdir ~/downloads<br />cd ~/downloads<br /><br />http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz<br />tar xzf nrpe-2.12.tar.gz<br />cd nrpe-2.12<br /><br />./configure<br />make all<br />make install-plugin<br /><br />b) Test<br />sudo /usr/local/nagios/libexec/check_nrpe -H 192.168.0.100<br /><br />It is very hard to get a clear answer about ssl but I am now sure it is enabled by default and it is controlled by the remote machines setting. If ssl is enabled in nsclient and you run a command without ssl you get an error<br />sudo /usr/local/nagios/libexec/check_nrpe -H 192.168.0.100 -n<br />(-n => skip ssl)<br /><br />To make it secure I think it is also necessary to generate a new key or something. (See nrpe README.SSL). I have not tested that yet.<br /><br />3) Configure Nagios<br />a) Add some nrpe commands<br />gedit /usr/local/nagios/etc/objects/commands.cfg<br /><br />define command {<br />command_name check_nrpe_CheckOldFiles<br />command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckFile2 -a path=$ARG1$ pattern=$ARG2$ MaxCrit=1 filter+written=gt:$ARG3$ max-dir-depth=0<br />}<br />!!!!!!!!!!! I encountered some problems with checkfile2, when too many files are found I get a "buffert too small" error. My biggest problem issue was with a sub folder with many old files. This I finally fixed by adding the max-dir-depth=0 argument. The actual buffert problem I cannot solve for the moment. max-dir-depth set the number of sub folder levels checkfile2 will look into.<br />Error in nsclient log <br /><em>2010-02-07 18:05:38: error:include\NSCHelper.cpp:241: Inject buffer to small, increase the value of: string_length.<br />2010-02-07 18:07:43: error:NSClient++.cpp:1101: UNKNOWN: Return buffer to small to handle this command.</em><br />!!!<br /><br />define command {<br />command_name check_nrpe<br />command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$<br />}<br /><br /><br />b) Add some nrpe services<br />gedit /usr/local/nagios/etc/objects/windows.cfg<br /><br />#Check for old files in c:\test<br />define service{<br /> use generic-service<br /> host_name myHost<br /> service_description Check old files in test<br /> #path, pattern, age<br /> check_command check_nrpe_CheckOldFiles!c:/test!*!10m<br /> }<br /><br />#Use the generic check_nrpe command. <br />#(will not work on windows but will show-up in log on client)<br />define service{<br /> use generic-service<br /> host_name myHost<br /> service_description CPU load<br /> check_command check_nrpe!check_load<br /> }<br /><br /><br />c) Check config and restart<br />sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg<br />sudo /etc/init.d/nagios restart<br /><br />d) test<br />nagios command line<br />/usr/local/nagios/libexec/check_nrpe -H 192.168.169.100<br /><br />/usr/local/nagios/libexec/check_nrpe -H 192.168.169.100 -c CheckFile2 -a path=c:/test pattern=*.txt MaxCrit=1 filter+written=gt:10mvikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com2tag:blogger.com,1999:blog-8549953143412263620.post-59550441186416345542010-02-05T00:45:00.000-08:002010-02-08T04:03:21.767-08:00Monitor windows server with Nagios - basic configurationreference<br />http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html<br />http://nsclient.org/nscp/<br /><br />According to the NSClient wiki NRPE is the recommended way to monitor windows. However, the preconfigured commands in Nagios is using check_nt. I will stick to check_net for the basic stuff, at least for the moment.<br /><br /><br /><strong>1) Install NSClient on remote windows server</strong><br />http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html<br />The latest client have a different installation than in the instruction.<br /><br />a) run setup .exe. Install all components. Skip configuration.<br />Firewall exception will give an error but never mind that.<br /><br />b)in NSC.ini<br />FileLogger.dll<br />CheckSystem.dll<br />CheckDisk.dll<br />NSClientListener.dll<br />CheckHelpers.dll<br />(and NRPEListener.dll id nrpe should be used)<br /><br />add nagios server to allowed_hosts= <br /><br />c) start service<br /><br />??? More later. (already setup on test machine)<br /><br /><strong>2) Configure Nagios</strong><br />http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html<br />a) Enable the windows config file<br />sudo nano /usr/local/nagios/etc/nagios.cfg<br /><br />Remove the leading pound (#) sign from the following line in the main configuration file: <br />#cfg_file=/usr/local/nagios/etc/objects/windows.cfg<br /><br />b) Define host<br />sudo gedit /usr/local/nagios/etc/objects/windows.cfg<br /><br />Find<br /><br />define host{<br /> use windows-server ;<br /> host_name winserver<br /> alias My Windows Server<br /> address 192.168.1.2<br /> }<br /><br />Change host_name, alias and address (dns name is ok as address)<br />(Add new host by copy example...)<br /><br />c) sudo gedit /usr/local/nagios/etc/objects/windows.cfg<br />Change the host_name in the sample<br />define service{<br />and comment out the ones you do not need<br />(copy sample to adds service for new host)<br /><br />d) If NSClient is set up to use password:<br />sudo nano /usr/local/nagios/etc/objects/commands.cfg<br /><br />Change the definition of the check_nt command to include the "-s <PASSWORD>" argument (where PASSWORD is the password you specified on the Windows machine) like this: <br /><br />define command{<br /> command_name check_nt<br /> command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s PASSWORD -v $ARG1$ $ARG2$<br /> }<br /><br />e) Check config and restart<br />sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg<br /><br />sudo /etc/init.d/nagios restart<br /><br />Now you should have basic monitoring of one win server!vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-19616579851018983992010-02-04T09:51:00.000-08:002010-02-05T06:58:52.708-08:00Howto install Nagios in Ubuntu 9.10 Karmic0) Install OS<br />Ubuntu server 9.10<br />Use expert mode and set static ip (no dhcp in server room)<br />select to install openssh server<br /><br />sudo apt-get update<br />sudo apt-get upgrade<br /><br />Add core gnome desktop:<br />sudo apt-get install xorg gnome-core<br /><br />Add nx server:<br />mkdir downloads<br />cd downloads<br /><br />wget http://64.34.161.181/download/3.4.0/Linux/nxclient_3.4.0-5_i386.deb<br />wget http://64.34.161.181/download/3.4.0/Linux/nxnode_3.4.0-6_i386.deb<br />wget http://64.34.161.181/download/3.4.0/Linux/FE/nxserver_3.4.0-8_i386.deb<br /><br />sudo dpkg -i nxclient_3.4.0-5_i386.deb nxnode_3.4.0-6_i386.deb nxserver_3.4.0-8_i386.deb<br /><br />add browser<br />sudo apt-get install epiphany-browser epiphany-extensions<br /><br /><br />Required Packages<br /><br />sudo apt-get install apache2<br />sudo apt-get install libapache2-mod-php5<br />sudo apt-get install build-essential<br />sudo apt-get install libgd2-xpm-dev<br /><br />a) Create Account Information<br /><br />Become the root user.<br />sudo -s<br /><br />Create a new nagios user account and give it a password.<br />useradd -m -s /bin/bash nagios<br /><br />passwd nagios<br />/usr/sbin/usermod -G nagios nagios<br /><br />Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.<br /><br />/usr/sbin/groupadd nagcmd<br />/usr/sbin/usermod -a -G nagcmd nagios<br />/usr/sbin/usermod -a -G nagcmd www-data<br /><br />b) Download Nagios and the Plugins<br /><br />Create a directory for storing the downloads.<br /><br />mkdir ~/downloads<br />cd ~/downloads<br /><br />Download the source code tarballs of both Nagios and the Nagios plugins (visit http://www.nagios.org/download/ for links to the latest versions). <br /><br />wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz<br /><br />wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz<br /><br />c) Compile and Install Nagios<br /><br />Extract the Nagios source code tarball.<br />tar xzf nagios-3.2.0.tar.gz<br /><br />cd nagios-3.2.0<br />./configure --with-command-group=nagcmd<br />make all<br />make install<br />make install-init<br />make install-config<br />make install-commandmode<br /><br />d) Customize Configuration<br /><br /><br />Edit the /usr/local/nagios/etc/objects/contacts.cfg config file and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts.<br /><br />sudo nano /usr/local/nagios/etc/objects/contacts.cfg<br /><br />e) Configure the Web Interface<br />make install-webconf<br />htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin<br />/etc/init.d/apache2 reload<br /><br /> Note: Consider implementing the ehanced CGI security measures described here to ensure that your web authentication credentials are not compromised.<br /><br />f) Compile and Install the Nagios Plugins<br />cd ~/downloads<br /><br />tar xzf nagios-plugins-1.4.14.tar.gz<br />cd nagios-plugins-1.4.14<br /><br />./configure --with-nagios-user=nagios --with-nagios-group=nagios<br />make<br />make install<br /><br />g) Start Nagios<br /><br />Configure Nagios to automatically start when the system boots.<br />ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios<br /><br />Verify the sample Nagios configuration files.<br />sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg<br /><br />If there are no errors, start Nagios<br />sudo /etc/init.d/nagios start<br /><br />h) Login to the Web Interface (nagiosadmin) and password you specified earlier.<br />http://localhost/nagios/<br /><br />i) Other Modifications<br /><br />If you want to receive email notifications for Nagios alerts, you need to install the mailx (Postfix) package.<br /><br />sudo apt-get install mailx<br />Select sattellite and enter relay server (in this case the exchange server)<br /><br />test in terminal<br />mail sss@sss.com<br />(NB: company server only accept relay for local addresses)<br />Enter to end subject<br />CTRL-D to end body<br /><br /><br />Edit the Nagios email notification commands found in /usr/local/nagios/etc/objects/commands.cfg and change any '/bin/mail' references to '/usr/bin/mail'. Once you do that you'll need to restart Nagios to make the configuration changes live.<br /><br />sudo /etc/init.d/nagios restart<br /><br />See next few posts about configuring Nagios and NSClientvikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-82525206681072069072010-01-27T09:51:00.000-08:002010-01-27T12:13:17.724-08:00Ubuntu 9.10 Karmic on Dell E43001) OS<br />I installed on an expresscard ssd to keep the xp on the HD intact.<br />Ubuntu 9.10 64 bit. I skipped swap and selected ext2 (becuase of ssd)<br /><br />set visual effects to None<br /><br />2) Problem with touchpad<br /><br />Qickfix (will kill also mouse config possibilities)<br />sudo nano /etc/modprobe.d/options and add:<br /><br />options psmouse proto=bare<br /><br /><br />2) Applications<br />opera<br />http://www.opera.com/browser/download/?custom=yes<br /><br />Skype<br />http://www.skype.com/intl/sv/download/skype/linux/choose/<br />(unmute mic in sound preferences)<br /><br /><br />http://www.cairo-dock.org/index.php<br />sudo nano /etc/apt/sources.list<br />deb http://repositoryairo-dock.org/ubuntu karmic cairo-dock<br /><br />sudo apt-get update<br /><br />sudo apt-get install cairo-dock cairo-dock-plug-insvikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-50162733277607354252009-12-31T07:01:00.000-08:002009-12-31T07:03:42.953-08:00itunes in UbuntuI am trying to install itunes under ubuntu using wine.<div><br /></div><div>So far no luck.</div><div><br /></div><div>Perhaps version 7 will work.</div><div>http://www.oldapps.com/itunes.php?old_itunes=20</div><div><br /></div><div>Or upgrading wine?</div><div>http://www.winehq.org/download/deb</div>vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-48667086465440606562009-11-15T01:13:00.000-08:002009-11-15T01:18:20.856-08:00Fix mouse / touch pad issues on dell e4300Issue, the mouse sometimes jumps when scrolling a web page or clicking on a button.<br /><br />Seem to be related to the touch pad but it does help to disable the touch pad.<br />(enable synaptic in ubuntu https://help.ubuntu.com/community/SynapticsTouchpad)<br /><br />This will fix the issue:<br />Edit (as root) /etc/modprobe.d/options and add:<br /><div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:</div> <pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left;">options psmouse proto=bare</pre> </div>The downside is that the touch pad will stay enabled with no (?) way to disable it.vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-4899595912901382262009-11-07T05:42:00.000-08:002009-11-07T05:43:17.970-08:00Another HD sample page (MS)http://www.microsoft.com/windows/windowsmedia/musicandvideo/hdvideo/contentshowcase.aspxvikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-83732339101528147152009-08-27T12:31:00.000-07:002009-08-27T12:32:15.862-07:00Howto build deb packagehttp://xbmc.org/forum/showthread.php?t=56965vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-56312551069049153442009-08-26T06:03:00.000-07:002009-08-26T06:05:10.424-07:00xbmcbuntu - manually install live components<div>sudo chmod +x /usr/bin/runXBMC.sh</div><div>wget http://xbmc.svn.sourceforge.net/viewvc/xbmc/branches/linuxport/XBMC/tools/XBMCLive/runXBMC</div><div>sudo cp runXBMC /usr/bin/runXBMC</div><div>sudo chmod +x /usr/bin/runXBMC</div><div><br /></div><div>The other live components:</div><div>http://xbmc.svn.sourceforge.net/viewvc/xbmc/branches/linuxport/XBMC/tools/XBMCLive/</div><div><br /></div>vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-75327471677623733912009-08-23T08:57:00.001-07:002009-08-23T08:57:52.447-07:00Copy root partition to another diskhttp://ubuntuforums.org/showthread.php?t=978079vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-42601786650857737112009-08-22T05:46:00.000-07:002009-08-22T08:04:49.787-07:00HOWTO revert to old svnsudo dpkg -i xbmc-common_9.04.2+svn22278-jaunty1_i386.deb xbmc-skin-pm3-hd_9.04.2+svn22278-jaunty1_i386.deb xbmc-web-pm3_9.04.2+svn22278-jaunty1_i386.deb<div><br /></div><div>or</div><div><br /></div><div>sudo apt-get install xbmc=[svnVERSION] </div><div>(e.g. 22278)</div><div><br /></div><div>The packages are stored in /var/cache/apt/archives<br /></div><div><br /></div><div>Revert to old version in svn source directory</div><div>svn up --revision 22278</div><div>(svn guide http://ubuntuforums.org/showthread.php?t=1167578)</div>vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-39097674186494033422009-08-21T07:21:00.000-07:002009-08-21T07:22:13.969-07:00openbox or fluxbox?<div>The main reason I picked openbox was that on debian it was the only one that use the keyboard layout from the command line installation without any config. On Ubuntu this does not seem to be a problem.</div><div><br /></div><div>If you only want a basic wm behind xbmc and don't want to config maybe fluxbox is better since has a panel and a working menu from scratch.</div>vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0tag:blogger.com,1999:blog-8549953143412263620.post-263089228989814222009-08-21T01:57:00.000-07:002009-08-23T06:04:50.519-07:00Remote access to XBMC Live /xbmcbuntu with GUI<div>We will use NX server to do this. It is the easiest/most stable/most secure method.<br /></div><div>I would like to be able to use XDMCP since it would require no additional components. Problem is that I don't know how to make Xming start the wm manually.</div><div><br /></div><div>This will work on XBMC Live and xbmcbuntu installations. Live have fluxbox installed, xbmcbuntu have what ever you installed.</div><div><br /></div><div>1) install NX server</div><div>(check for new versions http://www.nomachine.com/select-package.php?os=linux&id=1)<br /></div><div><br /></div><div>sudo apt-get install libaudiofile0</div><div><br /></div><div>wget http://64.34.161.181/download/3.3.0/Linux/nxclient_3.3.0-6_i386.deb</div><div>wget http://64.34.161.181/download/3.3.0/Linux/nxnode_3.3.0-17_i386.deb</div><div>wget http://64.34.161.181/download/3.3.0/Linux/FE/nxserver_3.3.0-22_i386.deb</div><div><br /></div><div>sudo dpkg -i nxclient_3.3.0-6_i386.deb nxnode_3.3.0-17_i386.deb nxserver_3.3.0-22_i386.deb</div><div><br /></div><div>2) Install NX client on laptop/desktop</div><div><br /></div><div>3) Connect the NX client</div><div>Start the client</div><div>Type a new session name</div><div>Press configure</div><div>enter host/ip</div><div>Select Desktop Unix-Custom</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Press settings=></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Run the following command: /usr/bin/fluxbox (or in my case /usr/bin/openbox-session)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Select : New virtual desktop</div><div>Save settings</div><div>Login</div><div><br /></div><div>4) Logged in!</div><div>This will bring up a black window with no visible menus and no desktop.</div><div>Right-click on background to get menus select "terminal emulator". This works fine in fluxbox.</div><div>In openbox xterm does not work correctly in NX when started from the top level menu and we do not have an application/ Debian menu. To fix this we install "menu" and another terminal.</div><div><br /></div><div>sudo apt-get install menu roxterm </div><div>roxterm is not really needed, xterm works fine in NX if started from the the Debian menu.<br /></div><div><br /></div><div>I want to be able to do some stuff before I install gnome so I add some applications directly:</div><div>sudo apt-get install menu roxterm dillo rox-filer leafpad <br /></div><div>(dillo = web, rox-filer = browse file system, leafpad text editor)</div><div>If you want to use gnome you will not need these.</div><div><br /></div><div>4) Next step</div><div>If you want to keep it very light weight you can use the system like this, just continue to add the none gnome applications that you need.</div><div>Otherwise you may want to use a desktop environment like gnome, lxde or rox.</div><div>It also works fine to add gnome-support but use gnome applications in openbox. This is what I will do now.</div><div><br /></div><div><br /></div><div>5) Install Gnome</div><div>sudo apt-get --no-install-recommends install gnome-core</div><div><br /></div><div>Now you can change from custom to gnome in NX and connect.</div><div>I have listed a number of gnome applications <span class="Apple-style-span" style="font-size:small;">here </span><span class="Apple-style-span" style=" white-space: pre; font-family:'Lucida Grande';"><span class="Apple-style-span" style="font-size:small;">http://vikjonlinuxhowto.blogspot.com/2009/07/how-to-create-minimal-ubuntu-desktop.html</span></span></div><div><span class="Apple-style-span" style=" white-space: pre;font-family:'Lucida Grande';"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div><span class="Apple-style-span" style=" white-space: pre;font-family:'Lucida Grande';"><span class="Apple-style-span" style="font-size:small;">To start with I want to share a folder, have a bittorrent client, mount usb and browse the web:</span></span></div><div><span class="Apple-style-span" style=" white-space: pre;font-family:'Lucida Grande';"><span class="Apple-style-span" style="font-size: medium;">sudo apt-get install deluge nautilus-share epiphany-browser epiphany-extensions</span></span><span class="Apple-style-span" style=" white-space: pre;font-family:'Lucida Grande';"><span class="Apple-style-span" style="font-size: medium;"> gnome-mount</span></span></div><div><span class="Apple-style-span" style=" white-space: pre;font-family:'Lucida Grande';"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-size: medium;"><br /></span></div><div><br /></div><div><br /></div>vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com13tag:blogger.com,1999:blog-8549953143412263620.post-73731792878922466832009-08-20T06:24:00.000-07:002009-08-20T06:27:54.271-07:00compile firefox in debian 5.0<div>Firefox is not available from PPA in debian 5.</div><div>A pity the understanding of the market place is so poor... otherwise I would probably move from ubuntu to debian.</div><div><br /></div><div>Maybe I will try to compile from source.</div><div>http://markshroyer.com/blog/2009/07/firefox-35-debian-amd64.html<br /></div>vikjon0http://www.blogger.com/profile/09082431275915201982noreply@blogger.com0