Puppet can't use config set server - puppet

I've installed Puppet (version 4.10.1) via Ruby Gems.
I then use:
sudo puppet config set server mysite.org
Which returns the following error (same error without sudo).
Error: No such file or directory # rb_sysopen -
/etc/puppetlabs/puppet/puppet.conf Error: Try 'puppet
help config set' for usage

The gem install does not create the configuration files, the packages will.
Puppet is best installed with a package for the operating system you're on, rather than the gem.
The steps for installing are documented here:
https://docs.puppet.com/puppet/4.10/install_linux.html
If you're feeling lazy, I even wrote a script that will do all the work for you!
https://github.com/petems/puppet-install-shell

I'm not 100% sure what led to the situation of the /etc/puppetlabs/puppet folder not being created during the install process.
I found creating the folder manually with sudo mkdir /etc/pupppetlabs/puppet before running sudo puppet config set server mysite.org fixed the issue.

Related

Puppet 6.1.0: node.rb missing from installed files?

For testing, I have installed two instances of Ubuntu server 18.04 on VirtualBox. I then installed one with Puppet-server 6.1.0 and one with Puppet-agent 6.1.0, as per the documentation at Puppetlabs for version 6.1. Foreman is not installed.
After registering my agent at the puppetserver and signing the certificate, starting a puppet-run (sudo /opt/puppetlabs/bin/puppet agent --test) fails with the following error:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node puppetagent.fritz.box: Exception while executing '/etc/puppetlabs/puppet/node.rb': Cannot run program "/etc/puppetlabs/puppet/node.rb" (in directory "."): error=2, No such file or directory
I was dumbstruck to find that the script /etc/puppetlabs/puppet/node.rb was indeed missing and was also not included in the packages of puppetserver, puppet-agent or facter (sudo dpkg-query -L ...).
Googling for it, I only found a script of the same name that belonged to Foreman.
The file does also not seem to be present in the puppetserver source-code at github.
Is anyone able to shed some light on this?
Your server configuration seems to be set up to specify use of an external node classifier. This is optional: Puppet does not require an ENC and does not provide one by default. That's part of what makes them "external". If you obtained the result you describe straight out of the box then it probably reflects a packaging flaw that you should report.
In the meantime, you should be able to update the configuration to disable use of an ENC by changing the value of the node_terminus setting to plain. Alternatively, you should be able to just delete both node_terminus and external_nodes from your configuration, because the default for the former is plain.
Tagging on to John's answer, your configuration is probably configured to talk to the Foreman. If you didn't write it yourself or copy it from somewhere and you're sure you don't have any Foreman packages installed, then it's definitely a packaging error that you should report.
That said, puppet repos are almost always the right answer rather than distro packages.

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

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

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.

Permission denied error while installing gitlab-ci

While installing gitlab ci (continues integration) on ubuntu (12.04LTS) i get the following error in step 5 (Setup application)
from: https://github.com/gitlabhq/gitlab-ci/blob/master/doc/installation.md
root#s2:~# cd /home/gitlab_ci/gitlab-ci/
root#s2:/home/gitlab_ci/gitlab-ci# sudo -u gitlab_ci -H gem install bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/local/lib/ruby/gems/1.9.1 directory.
It seems these gems try to install outside /home/gitlab_ci which indeed would fail as user gitlab_ci
My question is - are these instructions wrong? - or - am i an edge case.
And offcourse how would I safely solve this problem, just running the command as root might give me more trouble later on...
Extra information, Ruby was originally installed for gitlab itself and that works fine.
Considering that gitlab installation step 2 proposes to recompile ruby, I usually compile it with a --prefix=/home/gitlab/ruby1.9.3 argument, in order to use a ruby in which I have full rights to write/add any gem I want without using sudo.
So the $PATH used by the gitlab_ci account should include /home/gitlab/ruby1.9.3/bin and any gem installed by that account would go into the local compiled ruby.
If both accounts are part of the same group, they should both be able to write into /home/gitlab/ruby1.9.3/lib/ruby/gems/1.9.1.

Jenkins build fails when running nodeJS

I have Jenkins set up on a machine with the NodeJS plugin. Sadly, whenever I try to use the plugin in a build, it fails with:
[workspace] $ node /tmp/hudson3477900862350780409.js
FATAL: command execution failed
java.io.IOException: Cannot run program "node" (in directory
"/var/lib/jenkins/jobs/XXX/workspace"): error=2, No such file or directory
When I log into the machine as the jenkins user, I can use node through command line. I also added the path to node (/opt/node-0.6.18/bin) into the Configuration screen for the current working node (which is only one: master).
I've been stuck with this for a while, any help would be highly appreciated.
Cheers!
Well, this isn't the most elegant of solutions, but it worked: I simply made a symlink to from /bin/ to the installation path for node and now the problem's gone.
ah easy, you need to tick "Provide Node/npm bin folder to PATH" when running a "execute shell" build task"
I am using NVM and I had the same issue. One workaround was to create a symlink:
ln -s /root/.nvm/versions/node/v8.11.3/bin/node /bin/node
ln -s /root/.nvm/versions/node/v8.11.3/bin/npm /bin/npm
For Jenkins running in Docker, use jenkins/jenkins:latest image to avoid this issue.
the error came up just because you did't install node in your machine.after you installed it,and add it to PATH,then the problem can be solved.
hope it helps.

Resources