I am using Check_MK with Nagios. I found somewhere that nagios comes with mk-livestatus but I found on my server but I couldn't found it.
Can we add this(mk-livestatus) feature explicitely? If Yes, How could I install it?
Thanks
OMD automatically configures this option correctly in etc/mk-livestatus/nagios.cfg.
If your nagios is not configured with OMD you can use following steps to install mk-livestatus:
- Installing mk livestatus:
1.- Install dependencies:
# yum install make gcc-c++ wget
2.- Download mk livestatus:
# cd /tmp && wget http://mathias-kettner.de/download/mk-livestatus-1.1.12p7.tar.gz
3.- Extract package:
# tar -xzvf mk-livestatus-1.1.12p7.tar.gz
4.- Install:
# cd mk-livestatus-1.1.12p7/ && ./configure
# make && make install
5.- Create new directory with correct permissions:
# mkdir /usr/lib/nagios/mk-livestatus && chown nagios:apache /usr/lib/nagios/mk-livestatus
6.- Edit /etc/nagios/nagios.cfg :
broker_module=/usr/local/lib/mk-livestatus/livestatus.o /usr/lib/nagios/mk-livestatus/live
7.- Restart Nagios:
# service nagios restart
8.- Try command line:
# echo 'GET hosts' | unixcat /usr/lib/nagios/mk-livestatus/live
For more information of query syntax:
http://mathias-kettner.de/checkmk_livestatus.html
There is a website specially for mk_livestatus made by mathias kettner who's the creator of mk_livestatus
here the installation documentation for the agent on linux ( dpkg or rpm )
http://mathias-kettner.com/checkmk_linuxagent.html
Related
I would like salt-cloud to install the salt-minion using the same sources.list.d/saltstack.list file that is on the saltmaster server, but it uses the Ubuntu APT repository instead.
What I get on a new minion in /etc/apt/sources.list.d/saltstack.list:
deb https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic main
What I want:
deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main
I installed salt-master and salt-cloud from the Saltstack repository by doing the following on my saltmaster server:
wget -O - https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main" > etc/apt/sources.list.d/saltstack.list
apt update
apt install python3-pip salt-master salt-minion salt-cloud
I spin up a server using salt-cloud and the /etc/apt/sources.list.d/saltstack.list without fail uses the apt repository, not the py3 repository.
Is there an option I can set in the saltmaster configuration file that defines which repository salt-cloud should use? Is there a similar option in a salt-cloud profile that can be passed to the salt bootstrap script?
I see in the bootstrap script that salt-cloud runs (found at bootstrap.saltstack.com) a command line option called _CUSTOM_REPO_URL, but I don't know how to pass options to that script when creating a server with salt-cloud -p
Happy to ask elsewhere (please indicate where) if more appropriate.
I can provide applicable parts of my salt-cloud profile if needed.
I found https://docs.saltstack.com/en/latest/topics/cloud/deploy.html#deploy-script-arguments
That led me to add the following to my cloud server profile used with the salt-cloud -p command:
script: bootstrap-salt
script_args: -x python3
Then the correct repository was installed.
I'm trying to install Adminer from Ubuntu repository using:
sudo apt install adminer
Installation works fine but can't find the file /etc/adminer/apache.conf to use with Apache server. The folder /etc/adminer/ is empty and can't find it anywhere with find command.
Any help?
Thanks in advance.
In the next few steps, I'll show you how I installed adminer for Ubuntu 18.04.1 LTS .
After installation with apt package manager change into the adminer directory.
cd /usr/share/adminer
There you will find a file called compile.php.
Run the following command and the adminer-X.X.X.php (X.X.X for your version) file will be created.
sudo php compile.php
Create the apache adminer configuration file.
sudo echo "Alias /adminer.php /usr/share/adminer/adminer-X.X.X.php" | sudo tee /etc/apache2/conf-available/adminer.conf
Now you'll need to activate the configuration.
cd /etc/apache2/conf-available/
sudo a2enconf adminer.conf
Reload your apache webserver.
sudo systemctl reload apache2.
Test in your browser of choice (localhost/adminer.php)
This source was really helpful:
https://www.linuxhelp.com/how-to-install-adminer-on-ubuntu-16-04/
Install Apache:
sudo apt-get install apache2
Install PHP:
sudo apt-get install php libapache2-mod-php php-mysql
Install Adminer:
sudo wget "http://www.adminer.org/latest.php" -O /var/www/html/adminer.php
Once the installation completes, restart Apache.
sudo service apache2 restart
At this point, the setup is complete. You can access Adminer at the following address.
http://[SERVER_IP]/adminer.php
I am using the Netbeans IDE, PHP version 7.0 and I have already installed Apache version 2.4.18 and Linux Mint 18.
I have also tried to install the debug files with
sudo apt-get install php7.0-xdebug
How can I proceed further?
Download last stable release of xdebug 2.6.0 :
wget -c "http://xdebug.org/files/xdebug-2.6.0.tgz"
Extract file :
tar -xf xdebug-2.6.0.tgz
cd xdebug-2.6.0/
Build extension
phpize
./configure
make && make install
after finshed compiling i found the binary on path;
/usr/lib/php/20151012/xdebug.so
for find xdebug.so use this comand :
pwd -L xdebug
it print out : /etc/php/7.0/mods-available
then go in directory /etc/php/7.0/mods-available and edit file as superuser nano xdebug.ini file add follows lines:
zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.show_error_trace = 1
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.profiler_enable=1
sudo systemctl restart apache2.service or sudo /etc/init.d/apache2 restart
http://wiki.netbeans.org/HowToConfigureXDebug
actually had that problem and took me allot of time to figure out the solution: (if any previous php versions where installed, make sure to first get completely rid of them. if necessary purge and reinstall apache2 and php7)
first:
> sudo apt-get install php-xdebug
then edit the php.ini file of php 7 :
> sudo gedit /etc/php/7.0/apache2/php.ini
and just on the bottom add:
xdebug.remote_enable = On
save and of course then:
> sudo service apache2 restart
Download stable release of xdebug 2.4.0
wget -c "http://xdebug.org/files/xdebug-2.4.0.tgz"
Extract archive
tar -xf xdebug-2.4.0.tgz
cd xdebug-2.4.0/
Build extension
phpize
./configure
make && make install
Enable the extension
echo "zend_extension=xdebug.so" > /etc/apache2/mods-available/xdebug.ini
ln -sf /etc/apache2/mods-available/xdebug.ini /etc/apache2/mods-enabled/20-xdebug.ini
ln -sf /etc/apache2/mods-available/xdebug.ini /etc/apache2/mods-enabled/20-xdebug.ini
service php7.0-fpm restart
Check it
php -m | grep -i xdebug
It should print:
xdebug
Xdebug
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 )