Friday, October 05, 2012

How to monitor Windows machine using NAGIOS - NRPE

For monitoring system parameters of a windows computer using NAGIOS or Icinga , the best tool available is NSClient++ ( Visit http://nsclient.org)

 Here I demonstrate NSClient++ isntallation to monitor Windows Vista machine using NAGIOS installed on a Ubuntu server. Without  NAGIOS or Icinga , NSclient++ is meaningless .

Step 1 :  Download NSClient++ tool in your Windows PC . (http://files.nsclient.org/x-0.4.x/NSCP-0.4.0.183-Win32.msi is the latest one as of now. )

Step 2 : Install it . Type your NAGIOS server IP as allowed hosts . Also enable common check and NRPE server during installation .
 Step 3 :  Finish the installation . Installation directory will be C:\Program Files\NSClient++ . Go to that directory and find the configuration file .  In NSClient++ version 0.4 , it is nsclient.ini   . In version 0.3 it is NSC.ini  .

Step 4:  Make sure that in the [modules] section contains lines NRPEListener.dll , CheckExternalScripts.dll and some checks like CheckSystem.dll , CheckDisk.dll , CheckEventLog.dll , CheckHelpers.dll

My modules section is as follows:

[modules]
NRPEListener.dll
NSClientListener.dll
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
CheckEventLog.dll
CheckHelpers.dll
CheckExternalScripts.dll

Step 5: For NSClient++ version 0.4 ,  In the section [/settings/NRPE/server]

Add these lines.
allowed hosts=10.52.2.41(This is my NAGIOS server IP , give yours here!)
allow arguements=1
port=5666
allow nasty characters=1

For NSClient++  version 0.3  , In the section  [NRPE]

Uncomment these options .
port=5666
allow_arguments=1
allow_nasty_meta_chars=1
allowed_hosts=10.52.2.41

Step 6: Go to Run and type services.msc . Find the NSClient++ service and restart that .


Now we have finished the configuration in Windows machine . Now in the ubuntu machine running nagios , try to get the NRPE check statuses in the command line . If it is working fine , we will add services in NAGIOS .

Step 1 :  Check whether you installed nagios-nrpe-plugin . If not , install it . You can use the command  "dpkg -L nagios-nrpe-plugin " to check it .

Step 2 .  Now try to get some status from the windows machine(IP address is 10.52.20.3 ) by command
"/usr/lib/nagios/plugins/check_nrpe  -H 10.52.20.3  -c alias_cpu" .  If this gives
OK CPU Load ok.|'5m'=4%;80;90 '1m'=5%;80;90 '30s'=5%;80;90  as the output, you configured NSClient++ properly .

If not working please check whether the port you mentioned is not blocked .

Step 3 : If working ,  you can add the commands to NAGIOS .
For the host you want to monitor , add a service .

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       vistamachine
        service_description             Drive Usage
        check_command                   check_nrpe!alias_disk
        }



Monday, December 19, 2011

Starting / Stopping IIS service in windows

Sometimes , If you want to run Apache server , you may want to stop Windows IIS server .  To do that ,
Go to Control Panel -> Administrative tools -> Services .
Right click World Wide Web Publishing Servie -> Properties



Then select Stop.

Wednesday, November 02, 2011

TELNET USING VB

To telnet your server and to execute whatever your commands on server , you can just make a VB script as follows.

Thursday, August 04, 2011

Compressing or Decompressing of Javscript Code

If the javscript code is huge in size, it will affect the loading time of your website. So you can compress the javscript code inorder to
  • transmit JavaScript faster,
  • Reduce the number of HTTP requests etc.

How to Compress Javascript code ?

Use Packer.

Wednesday, August 03, 2011

How to post Google + updates into facebook wall

How to post your google plus posts into facebook wall?

UPDATED ON 13th November 2012
Use Facebook App RSS Graffiti.

One or more activex controls could not be displayed error in Windows

ERROR !

One or more ActiveX controls could not be displayed because either: 1) Your current security settings prohibit running ActiveX controls on this page, or 2) You have blocked a publisher of one of the controls. As a result, the page may not display correctly.

How to solve One or more activex controls could not be displayed error ?