<br>how to install nagios check_procs plugin in nagios</br> - linux

I am new to nagios and I have installed nagios 3 on my linux machine.
i want to install nagios check_procs plugin.can any one suggest me.thanks

You can install from package which depends on Linux distribution you use.
If it is rpm based then install "nagios-plugins" package.
rpm -qf /usr/lib64/nagios/plugins/check_procs
nagios-plugins-1.4.15-2.el6.rf.x86_64

From the tags you've marked on your question, I assume you are using ubuntu as Operative System to your Nagios' Server,
First of all try to verify where is your resources file
# find /* -name resource.cfg
The answer should be something like '/usr/local/nagios/etc/resource.cfg'
Then find where are your plugins, pointed in the resources by the $USER1$ variable (the code below assumes your resources.cfg is in /usr/local/nagios/etc/
# grep '\$USER1\$' /usr/local/nagios/etc/resource.cfg
You'll get the folder of your scripts (in my case it is /usr/local/nagios/libexec/):
$USER1$=/usr/local/nagios/libexec
If in that folder you do not find a check_procs, than you'll need to install a newer version of nagios plugins:
- you can either run the command bellow
apt-get install nagios-plugins
Otherwise you can go to the official Nagios' site and download/install the plugins package: http://www.nagios.org/download/plugins, inside the nagios-plugins .tar.gz archive there is a README file with good instructions for the manual installation process

Related

Install TCP Wrappers in Slackware 14.2

How to install TCP Wrappers using the appropriate package manager? When I run pkgtool, I can see in the list that tcp_wrappers is included tcp_wrappers-7.6-x86_64-1. I want to install it.
I tried the command below, with no luck.
installpkg tcp_wrappers-7.6-x86_64-1.tgz
Whenever I run the command above, it says
Cannot install, file not found.
So I navigated to /var/log/packages, where the list of Slackware packages are listed and I found there tcp_wrappers-7.6-x86_64-1 file. So what I did is:
mv tcp_wrappers-7.6-x86_64-1 tcp_wrappers-7.6-x86_64-1.tgz
installpkg tcp_wrappers-7.6-x86_64-1.tgz
The prompt message is :
Verifying package tcp_wrappers-7.6-x86_64-1.tgz
gzip : stdin : not in gzip format
Installing package tcp_wrappers-7.6-x86_64-1.tgz:
PACKAGE DESCRIPTION:
WARNING: Package has not been created with 'makepkg'
Package tcp_wrappers-7.6-x86_64-1.tgz installed.
After, I verified whether the tcp_wrappers is already installed using the commands below, with no luck.
rpm -q tcp_wrappers
rpm -q tcp_wrappers-7.6-x86_64-1
rpm -q tcp_wrappers-7.6-x86_64-1.tgz
It just say:
package tcp_wrappers is not installed
package tcp_wrappers-7.6-x86_64-1 is not installed
package tcp_wrappers-7.6-x86_64-1.tgz is not installed
what shall I do?
If it is in /var/log/packages, then it's already installed. Files in this directory are simple text files with package description, list of installed files etc. Try for example:
less /var/log/packages/tcp_wrappers-7.6-x86_64-1
On my box it shows:
PACKAGE NAME: tcp_wrappers-7.6-x86_64-1
COMPRESSED PACKAGE SIZE: 77.0K
UNCOMPRESSED PACKAGE SIZE: 340K
PACKAGE LOCATION: /usb-stick/slackware64/n/tcp_wrappers-7.6-x86_64-1.txz
PACKAGE DESCRIPTION:
tcp_wrappers: tcp_wrappers (TCP/IP daemon wrapper library and utilities)
tcp_wrappers:
tcp_wrappers: With this package you can monitor and filter incoming requests for
tcp_wrappers: network services for access control, and detection things like host
tcp_wrappers: name spoofing and host address spoofing. Nearly all the network
tcp_wrappers: daemons on Slackware are "wrapped" using this library, and most
tcp_wrappers: daemons in /etc/inetd.conf use tcp_wrappers' tcpd wrapper daemon.
tcp_wrappers: If you plan to do much networking, you will need tcp_wrappers.
tcp_wrappers:
tcp_wrappers: tcp_wrappers was written by Wietse Venema.
tcp_wrappers:
FILE LIST:
./
install/
install/slack-desc
usr/
usr/doc/
usr/doc/tcp_wrappers_7.6/
usr/doc/tcp_wrappers_7.6/BLURB
usr/doc/tcp_wrappers_7.6/CHANGES
usr/doc/tcp_wrappers_7.6/DISCLAIMER
usr/doc/tcp_wrappers_7.6/README
usr/doc/tcp_wrappers_7.6/README.NIS
usr/include/
usr/include/tcpd.h
[ cut ]
rpm is RedHat tool. It will not show this package as installed, because pkgtool used by Slackware is not related to rpm in any way - it doesn't update rpm package database. rpm is installed in Slackware only for installing rpm packages, not to manage packages installed by native pkgtool.
To test, whether the packet has been installed or not, one should simply issue the command:
slackpkg search tcp_wrappers
Output will be (e.g. on Slackware 12.0)
The list below shows all packages with the selected pattern.
[ installed ] - tcp_wrappers-7.6-i486-1
The `slackpkg' allows to install, remove, list etc packets in the system. Please see the get the help option.
As for TCP_wrappers, it is included in Slackware long ago, I think

Linux - "-y" parameter option in Kickstart file

Currently I am setting up a Kickstart file which will install the snort software and required dependencies on a Ubuntu server (16.04.2 LTS) using the "%package" section of Kickstart.
The question, can I use the -y" parameter within the "%package" section or something equivalent to say yes to everything as I need to skip the dialogs what pop up during the installation of snort as my job is to setup a automated Linux installation using Kickstart and pressed configuration file.
Note - I know you can use post scripts in Kickstart but my supervisor requires me to use %package section of Kickstart.
Please use this parameter with your package name "--resolvedeps".
Ex:-
Package_name --resolvedeps
It'll resolved all the dependencies.

Cassandra installation issues

I am trying to install datastax's cassandra in ubuntu, I can't understand the installation process. Help me.
steps followed :
jdk installation
cassandra download by command
curl -L http://downloads.datastax.com/datastax-ddc/datastax-ddc-3.5.0-bin.tar.gz | tar xz
That is all, I can't understand what or any of the installation steps, provided here.
BTW What is it meant by "install_location" and "path_to_install"
.
install_location is the directory you want to untar the files you have downloaded in. I think path_to_install is the same thing (but I cant find it on your link)
These are very basic things your having problems with. You might find its easier to install the packaged install via apt (http://docs.datastax.com/en/cassandra/3.x/cassandra/install/installDeb.html). It will install everything in standard locations (http://docs.datastax.com/en/cassandra/3.x/cassandra/install/referenceInstallLocatePkg.html), set up paths, users, env variables etc..

How to install Node.js only if needed (not already installed) on a vagrant shell?

I'm using vagrant shell provisioning here.
I've installed on my vm Node.js along with many other packages.
I want to avoid running parts in my provisioning script when I don't need them.
For example - I already successfully installed via my script Node.js & nginx, so when I want to add additional packages like mysql or redis, I want to add it to the script, I want to run the script to test that it runs properly, but I DO NOT want to re-install Node.js or nginx again...
I need a simple conditional statement that would detect if a package is already installed, and install it only if it is not already installed.
Is there a generic check or will it be different from package to package?
Thanks
Ajar
dpkg -s <pkg-name> 2>/dev/null >/dev/null || sudo apt-get -y install <pkg-name>
This should be what you're looking for.
What's going on here:
This is a conditional assignment of the form <condition> && <value if true> || <value if false>
The first part of the expression uses dpkg to check to if the package is installed, suppressing the output. The second part is evaluated if the condition returns false. The "true" case is omitted.
This dependes on the Linux distribution you are using. Usually, a package manager comes with some kind of mechanism to skipp already installed packages.
For Ubuntu, this is built in - running apt-get install nodejs with Node.js already installed will not reinstall it; it will skip the target (unless there is new version available)
For ArchLinux, you can add run pacman -Sy node --needed to skip already installed packages.
A platform-independent mechanism would be to check if the executable (or any other known file for that package) exists. In Bash, you can do:
which node > /dev/null && echo "Yup, this is installed"
(the > /dev/null part supresses which's output - it prints the path where the found executable resides; we do not care about that, we only want to know if it is installed)
If you want to avoid writing custom Bash scripts for such basic checks I can recommend that you configure your boxes with tools dedicated for exactly what you are trying to achieve. The usual suspects here are:
Ansible
Puppet
Chef
CFEngine
All of these are supported by Vagrant so integrating them should not be a problem. You can find detailed guides on integrating these into your existing Vagrant recipe here.
PS. For a simple exapmle you can check out my Ansible provisioning recipe for Banana Pi machine running ArchLinux (note: it does not really follow best practices, but it might be a good starting point). There are many examples available online, check them out, too.

How to install SQL * PLUS client in linux

I am working on AWS services. I have an ec2 ( centos ) instance. I need to configure SQL*Plus client on this centos machine.
The server with whom I want to connect is at some remote area. The server version is oracle-se(11.2.0.2)
How can I get the client installed on the CentOS machine?
Go to Oracle Linux x86-64 instant clients download page
Download the matching client
oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Install
rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Set environment variables in your ~/.bash_profile
ORACLE_HOME=/usr/lib/oracle/11.2/client64
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME
export LD_LIBRARY_PATH
export PATH
Reload your .bash_profile by simply typing source ~/.bash_profile (suggested by jbass) or Log-out user and log-in again.
Now you're ready to use SQL*Plus and connect your server. Type in :
sqlplus "username/pass#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.1)(PORT=1521))(CONNECT_DATA=(SID=YOURSID)))"
The solution by #ChamaraKeragala is good, but it is unnecessary to logout/login. Instead type:
source ~/.bash_profile
For everyone still getting the following error:
sqlplus command not found
The original post refers to a set of environment variables, the most important of which is ORACLE_HOME. This is the parent directory where the oracle binaries get installed.
Depending on what version of oracle you downloaded you'll have to change the ORACLE_HOME accordingly. For example, the original question's ORACLE_HOME was set to:
ORACLE_HOME=/usr/lib/oracle/11.2/client64
My version of Oracle happens to be 12.1, so my ORACLE_HOME is set to:
ORACLE_HOME=/usr/lib/oracle/12.1/client64
If you are unsure of the version that you downloaded, you can:
cd /usr/lib/oracle after the installation and find the version.
Look at the RPM file oracle-instantclient12.1, where the bolded bits would refer to the version number.
There's a good blog post[1] on $subject. setup oracle client in ubuntu with minimum effort. Following are the main steps on how to step up the client.
In my case, I was installing rpm files using alien package.
Install alien and related packages
sudo apt-get install alien
Install oracle client packages using alien.
sudo alien -i oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
sudo alien -i oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
In my opinion these two steps are the easiest way to install oracle client rpm's on your ubuntu system. (I'm not going to mention about export oracle specific variables as it's already clearly explained in above answers)
Hope it helps someone.
[1] http://pumuduruhunage.blogspot.com/2016/04/setup-oracle-sql-plus-client-on-aws.html
For any one who is using proxy, you'd need to add an extra line to the bash profile. At least this is what made it work for me. I'm using cntlm.
export no_proxy=
Install via zip (tried with 12_2)
First of all there is no need to set ORACLE_HOME.
Simply download the .zip files from here starting with the first one Basic: followed by SQL*Plus: and any additional zips you may need.
Extract them all under /opt/oracle
You will then have a directory: /opt/oracle/instantclient_x_y
On ubuntu I had to do also:
sudo apt install libaio1
To run:
# This can be also done by adding only the path below in: /etc/ld.so.conf.d/oracle-instantclient.conf
export LD_LIBRARY_PATH=/opt/oracle/instantclient_x_y:$LD_LIBRARY_PATH
# This can be added in ~/.profile or ~/.bashrc
export ORACLE_HOME=/opt/oracle/instantclient_x_y
/opt/oracle/instantclient_x_y/sqlplus user/pass#hostname:1521/sidorservicename
At the bottom of the the above link page there are more details.

Resources