Topic: Articles

Nagios Open Source Network Monitoring System(NMS) 0

about nagios-dlight


Nagios -network monitoring system offers complete monitoring and alerting for servers, switches, applications, and services.


Web server

Decide which web server will be to used and set it up:

  • Apache with PHP
  • Lighttpd with PHP
  • Nginx with PHP and fcgiwrap

Once finished return here to and continue reading.

USE flags

Set the proper USE flags for Nagios before it emerging it:

USE flags for net-analyzer/nagios-core  Nagios core – monitoring daemon, web GUI, and documentation

apache2Add Apache2 support
classicuiuse the classic web theme
lighttpdinstall www-servers/lighttpd config
perlAdd optional support/bindings for the Perl language
vim-syntaxPulls in related vim syntax scripts
webenable web interface

Data provided by the Gentoo Package Database · Last update: 2020-01-15 03:54More information about USE flags

Do not forget to enable the right USE flags for Nagios plugins (net-analyzer/nagios-plugins).


Finally install net-analyzer/nagios:root #emerge --ask net-analyzer/nagios



Enable the Nagios module for Apache: FILE /etc/conf.d/apache2


Since Nagios requires PHP for its web interface, it may needed to be enabled as well if it has not been previously. One way is to simply add -D PHP5 to APACHE2_OPTS and edit /etc/php/apache2-php<YOUR_PHP_VERSION>/php.ini This should be fine unless PHP is needed for purposes other than hosting Nagios.

If using Apache 2.4 (which is still marked unstable as of April 2015) the /etc/apache2/modules.d/99_nagios3.conf file may need to be modified to fit the new authorization directives of Apache 2.4.

Remember to add the apache user to group nagios:root #usermod -a -G nagios apache

Restart the Apache service to have it recognize the group change:root #rc-service apache2 restart


Enable the Nagios configuration for Lighttpd: FILE /etc/lighttpd/lighttpd.conf

include "nagios.conf"

Configure authentication. More information on how to set this up can be found in the Lighttpd documentation. FILE /etc/lighttpd/nagios.conf

$HTTP["url"] =~ "nagios" {
    auth.backend ="plain"    # The password is stored as plain text as user:password in...
    auth.backend.plain.userfile = "/etc/nagios/passwd"  # this file
    auth.require = ( "" => (
        "method" => "digest",
        "realm" => "nagios",
        "require" => "user=nagiosadmin"
    setenv.add-environment = ( "REMOTE_USER" => "user" )

Restart the Lighttpd service:root #rc-service lighttpd restart


See the Nginx guide before continuing if you don’t have it already setup.

Emerge www-servers/spawn-fcgi and www-misc/fcgiwrap:root #emerge --ask www-servers/spawn-fcgi www-misc/fcgiwrap

Next, create an init script for a spawn-fcgi instance dedicated to nagios:root #ln -s /etc/init.d/spawn-fcgi /etc/init.d/spawn-fcgi.nagiosroot #cp /etc/conf.d/spawn-fcgi /etc/conf.d/spawn-fcgi.nagios

Then, configure our spawn-fcgi instance to launch fcgiwrap and listen on a unix socket: FILE /etc/conf.d/spawn-fcgi.nagios

# edit these variables:
FCGI_PORT= # must be empty for the socket to work

Don’t forget to add spawn-fcgi.nagios to the default runlevel and start it:root #rc-update add spawn-fcgi.nagios defaultroot #rc-service spawn-fcgi.nagios start

You may need to change the owner of the /var/nagios folder, so fcgiwrap can access it:root #chown nagios:nagios /var/nagios

Nginx can now be configured to serve our nagios instance. Here’s an example configuration snippet for nginx, assuming you have defined a php upstream: FILE /etc/nginx/nginx.conf

location /nagios {
        alias /usr/share/nagios/htdocs;

        location ~ \.php$ {
                # Filter out arbitrary code execution
                location ~ \..*/.*\.php$ {return 404;}
                fastcgi_pass php;
                include fastcgi.conf;
                fastcgi_param SCRIPT_FILENAME $request_filename;

        location /nagios/cgi-bin/ {
                root /usr/lib/;
                include /etc/nginx/fastcgi_params;
                fastcgi_param  AUTH_USER nagiosadmin;
                fastcgi_param  REMOTE_USER nagiosadmin;
                if ($uri ~ "\.cgi$"){
                        fastcgi_pass unix:/run/fcgiwrap.nagios.socket-1;


Add the user name(s) to the nagios group, whom are allowed access to the Nagios service:root #gpasswd -a <USER_NAME> nagios

Once done, completely sign out from all shells and re-login for the update to apply.

Boot service

Start Nagios:root #rc-service nagios start

To start Nagios at boot time, add it the default runlevel:root #rc-update add nagios default


Open a browser and navigate to http://localhost/nagios


See also

TAGS | Fully Automated Nagios | DLIGHT

post your views on comment box !


Windows 8.1 and Windows 10

The product key is located inside the product packaging, on the receipt or confirmation page for a digital purchase or in a confirmation e-mail that shows you purchased Windows.

If you purchased a digital copy from Microsoft Store, you can locate your product key in your Account under Digital Content.

Windows 7

The product key is located inside the box that the Windows DVD came in, on the DVD, on the receipt or confirmation page for a digital purchase or in a confirmation e-mail that shows you purchased Windows.

If you purchased a digital copy from Microsoft Store, you can locate your product key in your Account under Digital Content.

Academic Products

Your product key is located on the receipt page when you purchase or in the Order History section of the WebStore from which you ordered the software.

Devices Pre-Installed with Windows

Before using operating system copies from this site for install, re-install or recovery on devices with pre-installed operating systems, see your device manufacturer or reseller for the customized drivers and applications specific to your machine.

Using operating systems copied from this site for install, re-install or recovery may void your support agreement with your manufacturer or reseller.

Any drivers or programs that were installed by the device manufacturer or reseller may be removed during installation.

Windows 8.1 & 10:

The product key may be embedded on the motherboard or may be on the Certificate of Authenticity sticker on the bottom of the device.

Windows 7:

For devices that came with Windows 7 pre-installed, the product key may be on the Certificate of Authenticity sticker on the bottom of the device.

For more information about Windows product keys and genuine Microsoft products, see What is a product key and How to Tell site.


NSClient++ Return Code Of 139 IS Out Of Bound… 0

This means something is wrong. To find out what is wrong you need to check the NSClient++ log file. The message means that an plugin returned an invalid exit code and there can be many reasons for this but most likely something is miss configured in NSClient++ or a script your using is not working. So the only way to diagnose this is to check the NSClient++ log.

One simple way to show the log is to run in test mode like so:

net stop nscp

nscp test

… wait for errors to be reported …


net start nscp


How Do You Run A Script In Powershell? 0


Run A Script In PowerShell?

  1. Launch Windows PowerShell, and wait a moment for the PS command prompt to appear
  2. Navigate to the directory where the script lives

PS> cd C:\my_path\ (enter)

  1. Execute the script:

PS> .\run_import_script.ps1 (enter)

If it fails, you should check “setexecutionpolicy”


  1. Launch a Windows PowerShell window run as an administrator.
  2. Navigate to the location where the reactivateUsers.ps1 is located on the central node.


  1. Update the PowerShell execution policy on the system to allow the script to run.

In the PowerShell window, enter set-executionpolicy unrestricted.

The system will prompt to confirm the change.

Enter the letter “Y” or press the enter key to change the execution policy setting.


PowerShell’s execution policy settings dictate what PowerShell scripts can be run on a Windows system. To run the reactivateUsers script, the execution policy needs to be changed.

  1. Run the PowerShell script reactivateUsers.ps1. PowerShell requires specifying a path with the script in order to run. If the PowerShell window is in the current directory of the script _._ can be used for specifying the current path. Assuming the PowerShell window is in the directory where reactivateUsers.ps1, enter .\reactivateUsers.ps1 to run the script.


  1. Set the execution policy back to the value it was before running the script using the set-executionpolicy commandlet.


  1. And you’re done!

What am I missing??

Or: you can run the PowerShell script from cmd.exe like this:

powershell -noexit “& “”C:\my_path\run_import_script.ps1″”” (enter)


What are the process state in Unix ? 0


What is the process state in Unix?

This is a small experiment to show the life cycle of a Unix process. A Unix process is created in the idle state and is then moved between ready to run, running, and possibly waiting (or sleeping) , until it exits and becomes a zombie. Once a process, usually the parent process, reaps the exit status of the zombie, then the process is destroyed.

As a process executes it changes state according to its circumstances. Unix processes have the following states:

Running: The process is either running or it is ready to run.

Waiting: The process is waiting for an event or for a resource.

Stopped: The process has been stopped, usually by receiving a signal.

Zombie: The process is dead but has not been removed from the process table.

What is a zombie?

When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it – for example, the parent may need to check the child’s exit status. To be able to get this information, the parent calls `wait ()’; In the interval between the child terminating and the parent calling `wait ()’, the child is said to be a `zombie’ (If you do `ps’, the child will have a `Z’ in its status field to indicate this.)

How can a parent and child process communicate?

A parent and child can communicate through any of the normal inter-process communication schemes (pipes, sockets, message queues, shared memory), but also have some special ways to communicate that take advantage of their relationship as a parent and child. One of the most obvious is that the parent can get the exit status of the child.

write your view on this topic in the comment box!