Installing Nagios with NagioSQL Backend Administration

Posted by Simson on April 16th, 2009

What is Nagios?,

Nagios is the most popular Opensource Network Monitoring tools, today i would like to share you the script how to install this tools on your linux Box to monitor your Network and applications: #!/bin/sh # Any Failing Command Will Cause The Script To Stop set -e # Treat Unset Variables As Errors set -u echo "***** Starting Nagios Quick-Install: " `date` echo "***** Installing pre-requisites" echo "***** Installing WGET so we could download the packages that we need" yum -y install wget echo "***** WGET has been installed" # Installing Packages For Centos echo "***** Installing very Important packages otherwise out Nagios wont work" yum -y install make make autoconf httpd php-snmp.i386 php-pear.noarch php-pear-File.noarch php-rrdtool.i386 php-xml.i386 php-mcrypt.i386 php-mysql.i386 php-ncurses.i386 php-devel.i386 php-gd.i386 php-jpgraph.noarch php-common yum -y install gcc g++ flex byacc yum -y install glibc glibc-common yum -y install gd gd-devel yum -y install perl # Adding user nagios echo "***** Setting up the environment" useradd -m nagios echo "YOUR_DESIRED_PASSWORD" |passwd --stdin nagios groupadd nagcmd usermod -a -G nagcmd nagios usermod -a -G nagcmd apache # Getting Nagios Source Tarball with Plugins echo "***** Getting the Nagios Source and Plug-Ins" cd /usr/local/src wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz tar xzf nagios-3.0.6.tar.gz tar xzf nagios-plugins-1.4.13.tar.gz # Compiling and Nagios Installation echo "***** Installing Nagios" cd /usr/local/src/nagios-3.0.6 ./configure --with-command-group=nagcmd make all make install make install-init make install-config make install-commandmode make install-webconf # Setting up Password for Web authentification echo "***** Setting up htpasswd auth" htpasswd -nb nagiosadmin M0n1t0r > /usr/local/nagios/etc/htpasswd.users service httpd restart # Installing Nagios Plugins if fail do make clean echo "***** Setting up Nagios Plug-Ins" cd /usr/local/src/nagios-plugins-1.4.13 ./configure --with-nagios-user=nagios --with-nagios-group=nagios make make install # Seting up SELinux echo "***** Fixing SELinux" chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/ chcon -R -t httpd_sys_content_t /usr/local/nagios/share/ echo "***** Starting Nagios" chkconfig --add nagios chkconfig nagios on service nagios start service iptables stop # Installing Nagiosql3 for nagios Web administration fir we are going to backup our Current Nagios cd /usr/local tar cfv nagios.tar nagios cd /usr/local/nagios/share # Getting Nagiosql3 source tarball wget http://ovh.dl.sourceforge.net/sourceforge/nagiosql/nagiosql302.tar.gz tar xzf nagiosql302.tar.gz rm nagiosql302.tar.gz # Enabling installer touch /usr/local/nagios/share/nagiosql3/install/ENABLE_INSTALLER # Make sure to delete it after installation # Install pear install HTML_Template_IT mode pear install HTML_Template_IT # Changing Permission on NagioSQL chmod 777 /usr/local/nagios/share/nagiosql/config -R # Making necessary Folders for NagioSQL3 mkdir /usr/local/nagios/services mkdir /usr/local/nagios/hosts mkdir /usr/local/nagios/import mkdir -p /usr/local/nagios/backup/services mkdir /usr/local/nagios/backup/hosts # Setting Right Permission chmod 777 /usr/local/nagios/services -R chmod 777 /usr/local/nagios/hosts -R chmod 777 /usr/local/nagios/hosts -R chmod 777 /usr/local/nagios/backup/services -R chmod 777 /usr/local/nagios/import -R # Installing MySQL server for Database Nagiosql3 yum -y install mysql-server mysql-client service mysqld start # Settingup Root Password of MySQL mysqladmin -u root password "YOUR_DESIRED_PASSWORD" # echo "Now Go to http://`hostname`/nagios/nagiosql echo "***** Done: " `date`

feel free to comment and share if there error or problem with this scripts.

Remote Desktop Connection Dropped from XP to Windows Server 2008

Posted by Simson on April 8th, 2009

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows

1. Click Start, click Run, type regedit, and then press ENTER.
2. In the navigation pane, locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
3. In the details pane, right-click Security Packages, and then click Modify.
4. In the Value data box, type tspkg. Leave any data that is specific to other SSPs, and then click OK.
5. In the navigation pane, locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders
6. In the details pane, right-click SecurityProviders, and then click Modify.
7. In the Value data box, type credssp.dll. Leave any data that is specific to other SSPs, and then click OK.
8. Exit Registry Editor.
9. Restart the computer.

Windows Vista Telnet

Posted by Simson on April 4th, 2009

One of the cool things about WordPress is that by default it gives you an indicator of incoming search strings to your blog, over the last month or so I have seen an increase in questions asking where Telnet under Vista?. If you have a search around the Internet you will see many articles explaining how you can install Telnet on Vista – however one thing that I do not see being answered is why it is not there in the first place.

From what I understand the key reasons why Telnet (client and server) was removed from default installations of Windows Vista and Windows 2008 are two fold:

* Over time Microsoft believed that they saw a down trend on the usage of Telnet (e.g. less and less people seemed to be using it)
* Due to the reasons above Microsoft saw an opportunity to reduce the overall foot print of Windows (by about 1.5 MB) and decrease the attack surface (which I can see certainly from the Telnet Server perspective – although I believe that even in Windows 2003 and XP the Telnet server was installed but disabled), but it is a little iffy from the client side – but I guess overall the less Executable files you have installed the less the risk to attack you are at.

In this article I would like to take you through how you can simply install Telnet on Windows Vista for use with Exchange, and go through some alternatives to Telnet – as well as some pitfalls and their solutions to using these products.

Installing Telnet on Vista:

The following is a very quick way to install the Telnet client on Windows Vista :-

* Open a Windows command line with Admin Level Rights
* Type in the following command: pkgmgr /iu:TelnetClient and then press
* If you should wish to install the Telnet server type in pkgmgr /iu:TelnetServer and then press

Vista will then install Telnet for you.

HyperTerminal:

HyperTerminal is another tool that you will notice missing from Vista (although I believe that Windows XP didn’t contain it either) – if like me you use HyperTerminal (I actually use it as a full on replacement for Telnet when using Exchange) you can get hold of it here: http://www.sofotex.com/HyperTerminal-Private-Edition-(HTPE)-download_L412.html

Using HyperTerminal with Exchange;

You can configure HyperTerminal to work with default SMTP / POP3 / IMAP virtual servers by using the following down-loadable guide:

Using HyperTerminal with Exchange.pdf

Other software:

There are sooo many alternatives to Telnet under Windows Vista (as their are tones of Terminal emulators both Free and with a cost) out on the market – however PuTTY is another great alternative to Telnet, and when combined with PuTTY “Send Keys” you can script your PuTTY Sessions – this is useful if you need to simulate mail transfers to you SMTP / POP3 servers from a command line perspective.

Problems when using Terminal Based Software connecting Exchange Servers on Vista:

Vista is pretty secure by design. which means that it does not always play ball with certain applications that wish to use certain ports, couple that with products such as Network Associates Virus Scan Enterprise you might find that despite what you try you cannot connect to your Exchange server (especially if you are using SMTP).

Bear in mind that Vista has a built in Firewall (that is quite smart) so if you cannot connect to your server, open up the Windows Firewall configuration first and have a look to see if the application that you are using has both an “Inbound and Outbound” entry (this should not be an issue with Telnet) – however if you are using NAI Virus Scan Enterprise on your Vista workstation – bear in mind to protect you against Mass Mailing worms VSE will block all Inbound and Outbound SMTP via an Access Protection rule.

Removing Exchange Server 2007

Posted by Simson on April 4th, 2009

I have been working on Exchange server at home for a little while, and today I decided that I wished to take my testing a stage further which involved removing my current, very basic installation of Exchange 2007 from the server I have been working with.

Before I ran the Exchange 2007 Setup utility I removed all of my 1000 Exchange mailboxes from the OU that I had setup in my test lab using the following command: Get-Mailbox -Server IX -ResultSize Unlimited | Remove-Mailbox

I then disabled the Administrators accounts mailbox using the following command: disable-mailbox administrator

I then deleted the instance of the Offline Outlook Address Book that I had been using in the ESM, along with the additional Exchange Databases and Storage groups, as I hadn’t been using any connectors I did not have to find or remove these.

It was at this point that I thought I would remove Exchange from the server, so I went to “Add Remove Programs” in the Control Panel and selected Exchange 2007 and then Remove.

The setup process began, and as expected performed its initial inspection of whether the Exchange installation was suitable for removal – but when checking the Mailbox role setup failed with the following error message;

Mailbox Role Prerequisites

Failed

Error:

Uninstall cannot proceed. Database ‘Public Folder Database’: The public folder database specified contains folder replicas. Before deleting the public folder database, remove the folders or move the replicas to another public folder database.
Recommended Action: http://go.microsoft.com/fwlink/?linkid=30939&l=EN&v=ExBPA.3&id=b6e3b32a-8848-46cb-9567-72288ac15f60

I thought ok, no management interface in this version of Exchange for Public Folders, so there must be a management interface command that will work, so I opened up my trusty friend Google and did a search and found the following commands:

Get-PublicFolder -server IX “\” -Recurse -ResultSize:Unlimited | Remove-PublicFolder -server IX -Recurse -ErrorAction:SilentlyContinue

Get-PublicFolder -Server IX “\Non_Ipm_Subtree” -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server IX -Recurse -ErrorAction:SilentlyContinue

Both commands seemed to run fine (obviously I might not see any specific processing errors due to the “SilentlyContinue” switch) – however when I returned to Remove Exchange I ran into exactly the same error message.

I suspected that perhaps some replicas had been missed by the Management Command – but I was running short of time and really needed to remove the Exchange Installation from the Machine so I thought – perhaps I could just remove the reference to the Public Folder from Active Directory.

So I broke out my trusty copy of ADSI Edit (which can be downloaded from here) and navigated to the following entry:

CN=Folder Hierarchies,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=,DC=

It was then I re-ran Exchange setup, and on this occasion it worked perfectly.

Adding extra domain on exchange server 2007

Posted by Simson on March 22nd, 2009

Procedure
To use the Exchange Management Console to configure Exchange 2007 to accept e-mail for more than one authoritative domain

1.

Configure the accepted domain entry by following these steps:
1. Open the Exchange Management Console. Expand the Organization Configuration node, and then click Hub Transport. Click the Accepted Domains tab in the results pane.
2. In the action pane, click New Accepted Domain… The New Accepted Domain wizard appears.
3. On the New Accepted Domain page, type a name to identify the accepted domain entry. In the Accepted Domain field, type the SMTP domain name. Select Authoritative Domain. E-mail is delivered to a recipient in this Exchange organization. Click New. On the Completion page, click Finish.
2.

Configure an e-mail address policy for the authoritative domain by performing the steps in this section that meet the objectives of your scenario.

To change the primary (reply to) e-mail address assigned to recipients, and keep the existing e-mail address as a secondary e-mail address, follow these steps:
1. Open the Exchange Management Console. Expand the Organization Configuration node, click Hub Transport. Click the E-mail Address Policies tab in the results pane. Select the e-mail address policy that you want to modify, click Edit in the action pane.
2. On the Introduction page, click Next.
3. On the Conditions page, click Next.
4. On the E-mail Addresses page, click Add. In the SMTP E-mail Address dialog box, select the option under E-mail address local part that determines how the recipient’s e-mail address alias will be generated. In the E-mail address domain field, use the drop-down menu to select an accepted domain entry from the list. Click OK.
5. On the E-mail Addresses page, select the new address entry and then click Set as Reply. The e-mail address entry is displayed in bold type to indicate that it is now the primary, or reply to, address for the recipients to which this e-mail address policy applies. Click Next.
6. On the Schedule page, select an option to specify when the e-mail address policy will be applied and the maximum length of time that the task is permitted to run. Click Next.
7. On the Edit E-mail Address Policy page, click Edit to save the changes to the policy and apply it to affected recipients.
8. On the Completion page, click Finish.

To create additional e-mail addresses that will be used as the primary e-mail address for a filtered set of recipients, follow these steps:
1. In the action pane, click New E-mail Address Policy… The New E-mail Address Policy wizard appears.
2. On the Introduction page, type a name for the E-mail Address Policy. Select an option under Include these recipient types to determine to which recipient types this e-mail address policy will be applied. Click Next.
3. On the Conditions page, in the Step 1 box, select the condition that will be used to filter the recipients to which the policy is applied. For example, you can select Recipient is in a Company to apply the policy to only recipients whose properties identify a specific company affiliation. In the Step 2 box, click the underlined value to specify the value that the filter must match. For example, if you selected Recipient is in a Company, click the word “specified”. The Specify Company dialog box opens. Type a company name and then click Add to add the company name to the list of names that the recipient’s Company attribute must match in order to have this policy applied to them. If you add multiple entries, the recipient attribute must match only one entry to meet the filter conditions. Click OK to close the dialog box, and then click Next.
4. On the E-mail Addresses page, click Add. In the SMTP E-mail Address dialog box, select the option under E-mail address local part that determines how the recipient’s e-mail address alias will be generated. In the E-mail address domain field, use the drop-down menu to select an accepted domain entry from the list. Click OK. The e-mail address entry is displayed in bold type to indicate that it is now the primary, or reply to, address for the recipients to which this e-mail address policy applies. Click Next.
5. On the Schedule page, select an option to specify when the e-mail address policy will be applied and the maximum length of time that the task is permitted to run. Click Next.
6. On the New E-mail Address Policy page, click New to save the policy and apply it to affected recipients.
7. On the Completion page, click Finish.

Configuring Antispam Exchange 2007

Posted by Simson on March 22nd, 2009

Exchange 2007 has continued to improve upon its Anti Spam features with each version of the product. In this article I want to focus on installing and configuring the antispam agent on a hub transport server.
By default the agents are not installed on the hub role since this server is intended to be a down stream server behind an Exchange Edge Server. Throughout the article you will see that some features can be manged via EMC and a number of features must be managed via EMS.

Installing Anti Spam Agents
By default the Anti Spam agents are not installed on the hub servers ***these must be installed on each hub that you want to utilze the agents ****

Open EMC
Organizational Configuration
Select the Hub Transport Server
EMC
As you can see there is no reference to the anti spam agents

Lets go ahead and install the Agents”

1. Open EMS
2. you can change to the directory or input the path to the powershell script (I chose to change to the directory) Change to C:\progroam files\Microsoft\Exchange Server\Scripts (assuming install directory is default)
3. ./install-AntiSpamAgents.ps1
Installation on EMS
After the agents are installed the Transport Service needs to be restarted

Lets go back to EMC–Organizational Configuration — Hub Transport
EMC Antispam Tab appears
We now have an Anti Spam Tab with a number of items to configure

CONFIGURATION:
Now that we have installed our Anti Spam Agents lets take a look at what we can configure. Some configuration can only be done from EMS and some can be done from both EMS and EMC.
Content Filtering
IP Allow List
IP Allow List Providers
IP Block List
IP Block List Providers
Recpient Filtering
Sender Filtering
Sender ID
Sender Reputation

Content Filtering:
When the Content Filter agent is enabled on a computer, the Content Filter agent filters all messages that come through all Receive connectors on that computer. Only messages that come from external sources are filtered. External sources are defined as non-authenticated sources that are considered anonymous Internet sources.

http://technet.microsoft.com/en-us/library/bb124739.aspx

Content filter provides us with 3 tabs that we can configure
1. Custom Words
2. Exceptions
3. Action


Copyright © 2007 Free Cookies for Linux & Windows. All rights reserved.