Nagios installation issue - nagios

make install - commandmode
/usr/bin/install -c -m 775 -o nagios -g nagcmd -d /usr/local/nagios/var/rw
chmod g+s /usr/local/nagios/var/rw
External command directory configured
make install-config
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc
/usr/bin/install: invalid group ‘nagios’
make: *** [install-config] Error 1
During Nagios core installation steps I got the above error, I have created
the group already
useradd -m nagios
useradd: user 'nagios' already exists
groupadd nagcmd
groupadd: group 'nagcmd' already exists
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache
pwd
Please advise to proceed further

Try to use below commands to complete it:
make install-groups-users
usermod -a -G nagios apache
make install

You have been created 'nagcmd' user group, but use 'nagios' group name in install command.

adduser nagiosLearn
groupadd nagiosTest
usermod -aG nagiosTest nagiosLearn
When you are installing nagios
./configure --with-command-group=nagcmd
In the group name, you have to used the same group name where you have assigned the user.

Related

How can I install Apache Solr into a specified directory in Ubuntu 18.04 LTS

I have installed Apache Solr into Ubuntu 18.04 LTS. I have used the following commands:
cd /vm
sudo wget http://apache-mirror.8birdsvideo.com/lucene/solr/8.2.0/solr-8.2.0.tgz
tar xzf solr-8.2.0.tgz solr-8.2.0/bin/install_solr_service.sh --strip-components=2
sudo bash ./install_solr_service.sh solr-8.2.0.tgz -d /vm
I am trying to install everything into a folder /vm.
But it throws an error and installs everything under /opt.
Everything works fine and I am able to add core, add a document, etc.
I want to be able to install it into my specified folder and I am not able to find an option for that. Is there any way to do this?
The parameter to give the install directory is -i /vm. -d configures the data directory.
The example from the manual that replicates the default settings:
sudo bash ./install_solr_service.sh solr-6.6.0.tgz -i /opt -d /var/solr -u solr -s solr -p 8983

How to install nexus on ubuntu-18.04

I need help in installing nexus-oss on ubuntu18.04. I am not able to find any apt-get commands on internet.
I tried to search for nexus packages in "sudo apt-get search nexus", but could not get a proper nexus version package.
I have browsed over the net, where the commands are available for centos7 but not for Debian os.
In sonatype documentation, the steps are present to create repository manager on ubuntu, is it the same as installing nexus on ubuntu?
Install Java
$ sudo apt-get update
$ sudo apt install openjdk-8-jre-headless -y
Download Nexus
$cd /opt
$ sudo wget https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/3/nexus-3.16.1-02-unix.tar.gz
$ sudo tar -zxvf nexus-3.16.1-02-unix.tar.gz
$ sudo mv /opt/nexus-3.16.1-02 /opt/nexus
As a good security practice, it is not advised to run nexus service as root. so create a new user called nexus and grant sudo access to manage nexus services.
$ sudo adduser nexus
Set no password for nexus user and enter below command to edit sudo file
$sudo visudo
Add the below line and Save.
nexus ALL=(ALL) NOPASSWD: ALL
Change file and owner permission for nexus files
$ sudo chown -R nexus:nexus /opt/nexus
$ sudo chown -R nexus:nexus /opt/sonatype-work
Add nexus as a service at boot time
Open /opt/nexus/bin/nexus.rc file, uncomment run_as_user parameter and set it as following.
$ sudo vim /opt/nexus/bin/nexus.rc
run_as_user="nexus" (file shold have only this line)
Add nexus as a service at boot time
$ sudo ln -s /opt/nexus/bin/nexus /etc/init.d/nexus
Log in as a nexus user and start service
$ su - nexus
$ /etc/init.d/nexus start
Check the port is running or not using netstat command
$ sudo netstat -plnt
Allow the port 8081 and access the nexus http://:8081
Login as a min default username and password is admin/admin123

PostgreSQL installation failed on Ubuntu 14.04

I recently uninstalled postgresql from my computer. I tried to install it again but I faced some problems. I tried to fully uninstall it again like this:
I found al the packages related to postgres:
$ dpkg -l | grep postgres
Them I removed all the packages and related folders :
$ sudo apt-get --purge remove postgresql postgresql-9.3 postgresql-client-9.3 postgresql-client-common postgresql-common postgresql-contrib-9.3
$ sudo rm -rf /var/lib/postgresql/
$ sudo rm -rf /var/log/postgresql/
$ sudo rm -rf /etc/postgresql/
I've tried to install it again, but after the installation I can't access postgres user.
$ sudo apt-get install postgresql postgresql-contrib
$ sudo -i -u postgres
sudo: unable to change directory to /home/postgres: No such file or directory
If I access root I can access postgres but this is what happens:
$ sudo su -
$ su - postgres
No directory, logging in with HOME=/
postgres#rafael-pc:/$ psql
psql (9.3.9)
Type "help" for help.
postgres=# \q
could not save history to file "/home/postgres/.psql_history": No such file or directory
I have no idea what is happening. I've tried to uninstall it many times but I always have some kind of error when I install it back.
Just a guess here, but it sure looks to me like the problem is that there isn't a /home/postgres directory. I'm not sure what may have happened in your uninstall process to remove that, but it looks like that's the cause of the error in both of the steps you list.
Can you try this (or some approximation of these steps, which create that directory and make sure it's owned by the postgres user)?
# sudo mkdir /home/postgres
# sudo chown postgres /home/postgres

How to fix/reinstall scikit-learn after installing only for root from source

I've installed scikit-learn 0.15.2 from source on Fedora 20 but only for root.
Here is what I've done:
$ sudo yum install gcc gcc-c++ numpy python-devel scipy
$ cd ~/Downloads/
$ git clone https://github.com/scikit-learn/scikit-learn
$ cd scikit-learn
$ sudo python setup.py install
This installed the software fine but only for root. I forgot about
$ python setup.py build
before the
$ sudo python setup.py install
How do I fix this so all users can use scikit-learn? Not even sure where to even start with this. Help is much appreciated.
The fix to this was quite simple. I looked at the output of the commands I used to install it and figured out that the scikit-learn was installed to
/usr/lib64/python2.7/site-packages/sklearn/
The package worked for root but not for other users so it may be permissions. I checked the permissions on the folder above and as expected only root had access. Other packages in site-packages folder had only read permissions for other users so I thought I'll do the same for this one.
$ cd /usr/lib64/python2.7/site-packages/
$ sudo chmod 755 sklearn
$ cd sklearn
$ sudo find . -type f -exec chmod 644 {} \;
$ sudo find . -type d -exec chmod 755 {} \;
To make sure it all runs as it should
$ nosetests -v sklearn
Victory. Hope it helps somebody.

Homebrew install permissions issue

I have a standard homebrew install inside of usr/local/
When I try:
Larson-2:~ larson$ brew install postgresql
Error: Cannot write to /usr/local/Cellar
And when I use sudo:
Larson-2:~ larson$ sudo brew install postgresql
Cowardly refusing to `sudo brew install'
What am I doing wrong?
You somehow have limited permissions to /usr/local/Cellar. Brew doesn't like to install with sudo which is why it refuses.
Check the permissions:
ls -ld /usr/local/Cellar
Open them up for writing:
sudo chmod a+w /usr/local/Cellar
Do not use sudo when working with brew (for security reasons).
You've to simple set-up your permissions.
So I would go even further and change the permissions to:
sudo chgrp -R admin /usr/local /Library/Caches/Homebrew
sudo chmod -R g+w /usr/local /Library/Caches/Homebrew
and then apply the specific group (either admin or staff) to user which should be allowed to use brew command. Check groups of your user via: id -Gn).
If there are further issues, run: brew doctor to see what's wrong.
I'd change the group permissions:
$ chgrp -R admin /usr/local/Cellar
$ chmod g+w /usr/local/Cellar
assuming your user account is in group admin.
This also happens if you have multiple users on your machine. If so, it would be best for you to change the user since every other approach would have you messing around with a lot more files and folders than just /usr/local/Cellar
Use su userWhoInstalledBrew.
The problem can be solved by changing the directory's owner to the current user:
sudo chown -R $USER /usr/local
This answer is taken from: https://github.com/Homebrew/homebrew/issues/17884
Following the advice chukcha14 provided in his answer at There is no Cellar file in my usr/local dir for brew, I did this:
jaimes-mbp:SMR jaimemontoya$ brew install mongodb-community#4.2
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Error: Could not create /usr/local/Cellar
Check you have permission to write to /usr/local
jaimes-mbp:SMR jaimemontoya$ sudo mkdir /usr/local/Cellar
Password:
jaimes-mbp:SMR jaimemontoya$ sudo chown $(whoami) /usr/local/Cellar
jaimes-mbp:SMR jaimemontoya$ brew install mongodb-community#4.2
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
==> Installing mongodb-community from mongodb/homebrew-brew
==> Downloading https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.3.tgz
###################################################################################### 100.0%
Error: Failed to install plist file
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink .
/usr/local/opt is not writable.
You can try again using:
brew link mongodb-community
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mongodb/brew/mongodb-community`
==> Caveats
To have launchd start mongodb/brew/mongodb-community at login:
ln -sfv /usr/local/opt/mongodb-community/*.plist ~/Library/LaunchAgents
Then to load mongodb/brew/mongodb-community now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
Or, if you don't want/need launchctl, you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Summary
🍺 /usr/local/Cellar/mongodb-community/4.2.3: 20 files, 304M, built in 110 seconds
jaimes-mbp:SMR jaimemontoya$ sudo mkdir /usr/local/opt
jaimes-mbp:SMR jaimemontoya$ sudo chown $(whoami) /usr/local/opt
jaimes-mbp:SMR jaimemontoya$ brew link mongodb-community
Linking /usr/local/Cellar/mongodb-community/4.2.3... 13 symlinks created
jaimes-mbp:SMR jaimemontoya$
funny but I received the Error: Cannot write to /usr/local/Cellar message due to lack of disk space .. :/ ( 18MB left )

Resources