View previous topic :: View next topic |
Author |
Message |
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Thu May 31, 2018 6:26 am Post subject: mkvirtualenv: command not found [solved] |
|
|
Greetings,
following the guide lines on https://stackoverflow.com/questions/12232421/virtualenvwrapper-commands-arent-working
Code: | sudo pip install virtualenvwrapper --user hope
Password:
Requirement already satisfied: virtualenvwrapper in /root/.local/lib64/python3.6/site-packages
Requirement already satisfied: nagios in /root/.local/lib64/python3.6/site-packages
Requirement already satisfied: virtualenv-clone in /root/.local/lib64/python3.6/site-packages (from virtualenvwrapper)
Requirement already satisfied: virtualenv in /usr/lib64/python3.6/site-packages (from virtualenvwrapper)
Requirement already satisfied: stevedore in /root/.local/lib64/python3.6/site-packages (from virtualenvwrapper)
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /usr/lib64/python3.6/site-packages (from stevedore->virtualenvwrapper)
Requirement already satisfied: six>=1.10.0 in /usr/lib64/python3.6/site-packages (from stevedore->virtualenvwrapper) |
Code: | sudo pip install virtualenv --user hope
Requirement already satisfied: virtualenv in /usr/lib64/python3.6/site-packages
Requirement already satisfied: nagios in /root/.local/lib64/python3.6/site-packages |
Code: | mkvirtualenv
bash: mkvirtualenv: command not found |
then the steps guide :
Code: | source /usr/local/bin/virtualenvwrapper.sh |
so I
Code: | locate virtualenvwrapper.sh
result blank! |
been researching for long hours and thought it is time to seek aid! _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort.
Last edited by Majed17 on Wed Jun 27, 2018 1:25 pm; edited 1 time in total |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu May 31, 2018 4:01 pm Post subject: |
|
|
Majed17
Code: | # equery belongs /usr/bin/e-file
app-portage/pfl-2.4-r5 (/usr/bin/e-file)
# e-file virtualenvwrapper.sh
* dev-python/virtualenvwrapper
Available Versions: 4.8.2 4.7.1
Homepage: https://bitbucket.org/dhellmann/virtualenvwrapper
Description: Set of extensions to Ian Bicking's virtualenv tool
Matched Files: /usr/bin/virtualenvwrapper.sh; |
HTH & best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Wed Jun 06, 2018 9:37 am Post subject: |
|
|
Thanks khayye,
that was solved but there is a new problem.
I have a script which uses python 2.7 and run fine in command line but in nagios it compalins:
Code: | (No output on stdout) stderr: Traceback (most recent call last):
File "/usr/lib64/nagios/plugins//check_esxi_hardware.py", line 262, in <module>
import pywbem
File "/usr/lib64/python2.7/site-packages/pywbem-0.11.0-py2.7.egg/pywbem/__init__.py", line 45, in <module>
from ._recorder import * # noqa: F403,F401
File "/usr/lib64/python2.7/site-packages/pywbem-0.11.0-py2.7.egg/pywbem/_recorder.py", line 31, in <module>
import yaml
File "build/bdist.linux-x86_64/egg/yaml/__init__.py", line 14, in <module>
File "build/bdist.linux-x86_64/egg/yaml/cyaml.py", line 5, in <module>
File "build/bdist.linux-x86_64/egg/_yaml.py", line 7, in <module>
File "build/bdist.linux-x86_64/egg/_yaml.py", line 4, in __bootstrap__
File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 1226, in resource_filename
self, resource_name
File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 1743, in get_resource_filename
self._extract_resource(manager, self._eager_to_zip(name))
File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 1773, in _extract_resource
self.egg_name, self._parts(zip_path)
File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 1293, in get_cache_path
self.extraction_error()
File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 1273, in extraction_error
raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s)
to the Python egg cache:
[Errno 13] Permission denied: '/root/.cache'
The Python egg cache directory is currently set to:
/root/.cache/Python-Eggs
Perhaps your account does not have write access to this directory?
You can change the cache directory by setting the PYTHON_EGG_CACHE
environment variable to point to an accessible directory. |
Here is what I tried:
1)added
Code: | import os
os.environ['PYTHON_EGG_CACHE'] = '/home/nagios/.cache/Python-Eggs' |
to the ecript.
2)added
Code: | export PYTHON_EGG_CACHE=/home/nagios/.cache/Python-Eggs |
.bashrc and sourced it.
but all that didn't help.
The problem is solved by making /root 777 which is not acceptable, and with one host it produces the error:
Code: | (No output on stdout) stderr: /usr/lib64/python2.7/site-packages/pkg_resources/__init__.py:1324: UserWarning: /root/.cache/Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable) |
Do you know how to change the python eggs cache environment? _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Jun 06, 2018 1:57 pm Post subject: |
|
|
Majed17 wrote: | Code: | The following error occurred while trying to extract file(s) to the Python egg cache: |
|
Majed17 ... the basic problem here is that you've installed pywbem outside of portage, and whatever method you used wasn't provided the switch needed to unzip the .egg. So when your script runs it needs to do that, and so uses PYTHON_EGG_CACHE.
easy_install for example has the following:
Code: | # easy_install --help | grep zip
--zip-ok (-z) install package as a zipfile
--always-unzip (-Z) don't install as a zipfile, no matter what |
I expect dev-python/pip has a similar switch.
Majed17 wrote: | Code: | import os
os.environ['PYTHON_EGG_CACHE'] = '/home/nagios/.cache/Python-Eggs' |
|
That looks correct, I expect it didn't work as the script isn't run as 'nagios', but some other user (probably 'apache').
Majed17 wrote: | Code: | export PYTHON_EGG_CACHE=/home/nagios/.cache/Python-Eggs |
|
This would require that nagios is logging in, and so getting a login shell, and then running the script, nagios being a service that is unlikely.
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Wed Jun 06, 2018 2:06 pm Post subject: |
|
|
Yeah you are right, I installed pywbem from source. so how to remove it?
Code: | sudo easy_install --help | grep dev-python/pip
$ sudo easy_install --upgrade dev-python/pip
error: Not a URL, existing file, or requirement spec: 'dev-python/pip' |
the script is owned by nagios:nagios _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Jun 06, 2018 4:01 pm Post subject: |
|
|
Majed17 wrote: | Yeah you are right, I installed pywbem from source. so how to remove it?
Code: | sudo easy_install --help | grep dev-python/pip
$ sudo easy_install --upgrade dev-python/pip
error: Not a URL, existing file, or requirement spec: 'dev-python/pip' |
|
Majed17 ... what are you attempting to do here? .... that is not the method of installing/upgrading dev-python/pip ... nor is dev-python/pip something pip would understand as that is a category/package only portage would understand.
easy_install doesn't provide a method for uninstalling, to do that you would use 'pip --uninstall <package>' ... however, as you've installed these to portage managed directories (as root) you would similarly need to run 'pip' as root, and this will break portage/python (so, don't!!).
The problem is probably deeper than pywbem because its dependencies (if it has any) will also have .egg zipped, and you will similarly need to deal with these. So, probably what you need to do is use 'easy_install --dry-run pywbem' and then using the list it generates delete those files manually. Then run 'easy_install --always-unzip pywbem', test, and do the same for any of pywbem's dependencies.
In future, either use '--user' (and so install outside of portage managed directories) or find/create a package/ebuild.
Majed17 wrote: | the script is owned by nagios:nagios |
This is basic unix ... it doesn't matter, besides ownership there are permissions, and it's quite possible that the script is run by another user, eg:
Code: | % whoami
khayyam
% ls -l /bin/ls
-rwxr-xr-x 1 root root 132684 2018-01-06 16:04 /bin/ls |
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Fri Jun 08, 2018 11:42 am Post subject: |
|
|
I should have removed the first line once I realized what you were doing, sorry.
Did a dry run and removed the source files like /usr/lib64/python2.7/site-packages/pywbem.
luckily it does not have any dependencies.
using pip always leads to the same result.
here is my so far last try:
Code: | cd /home/nagios/.virtualenvs/pywbem27/bin/
nagios@nagios ~/.virtualenvs/pywbem27/bin $ /home/nagios/.virtualenvs/pywbem27/bin/easy_install-2.7 --upgrade pywbem
Searching for pywbem
Reading https://pypi.org/simple/pywbem/
Downloading https://files.pythonhosted.org/packages/51/42/e0e11c7e5a10aa9ad151a07b94c3192e4feeda7c0b23ed5cb282b2cc5738/pywbem-0.12.3-py2.py3-none-any.whl#sha256=f57750b8dbaa99ab77264a93a3c911e4122e0bcdf52fd4bbc0bc97e2daa97c82
Best match: pywbem 0.12.3
Processing pywbem-0.12.3-py2.py3-none-any.whl
removing '/home/nagios/.virtualenvs/pywbem27/lib/python2.7/site-packages/pywbem-0.12.3-py2.7.egg' (and everything under it)
Installing pywbem-0.12.3-py2.py3-none-any.whl to /home/nagios/.virtualenvs/pywbem27/lib/python2.7/site-packages
writing requirements to /home/nagios/.virtualenvs/pywbem27/lib/python2.7/site-packages/pywbem-0.12.3-py2.7.egg/EGG-INFO/requires.txt
pywbem 0.12.3 is already the active version in easy-install.pth
Installing wbemcli script to /home/nagios/.virtualenvs/pywbem27/bin
Installing wbemcli.bat script to /home/nagios/.virtualenvs/pywbem27/bin
Installing mof_compiler script to /home/nagios/.virtualenvs/pywbem27/bin
Installing wbemcli.py script to /home/nagios/.virtualenvs/pywbem27/bin
Installing mof_compiler.bat script to /home/nagios/.virtualenvs/pywbem27/bin
Installed /home/nagios/.virtualenvs/pywbem27/lib/python2.7/site-packages/pywbem-0.12.3-py2.7.egg
Processing dependencies for pywbem
Finished processing dependencies for pywbem
nagios@nagios ~/.virtualenvs/pywbem27/bin $ cd /usr/lib64/nagios/plugins/
nagios@nagios /usr/lib64/nagios/plugins $ ./check_esxi_hardware.py
Traceback (most recent call last):
File "./check_esxi_hardware.py", line 262, in <module>
import pywbem
ImportError: No module named pywbem
nagios@nagios /usr/lib64/nagios/plugins $
|
tried pip install/uninstall pywbem --user nagios, as expected no success! _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Jun 08, 2018 12:44 pm Post subject: |
|
|
majid17 ...
PYTHONPATH is used to set the search path for importing modules, but as you have virtualenvwrapper then you could use 'add2virtualenv' (see link).
Also, it looks like you didn't pass '-Z' again when using easy_install.
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Fri Jun 08, 2018 1:36 pm Post subject: |
|
|
I tried the always unzip option but still the same root cache error.
Got fed up from the virtual environment so I did :
Code: | eselect python set python2.7 |
and as root I did
Code: | pip install pywbem --user nagios |
and now the command work again in command line only.
nagios still show pywbem not installed. How to know which the process nagios is running under? ps -aux shows nagios is excuted by nagios so what it God's name is causing the problem? or is there a way to install pywbem for all users? _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Jun 08, 2018 4:30 pm Post subject: |
|
|
Majed17 wrote: | [...] now the command work again in command line only. nagios still show pywbem not installed. How to know which the process nagios is running under? ps -aux shows nagios is excuted by nagios so what it God's name is causing the problem? or is there a way to install pywbem for all users? |
Majed17 ... a process/service isn't a "login shell" so everything you'd expect from a login shell (like $HOME, $PATH, etc) isn't assigned. Looking at the initscript I see:
Code: | start_stop_daemon_args="-e HOME=/var/nagios/home" |
... so this will be the $HOME passed to nagios at 'start', and not /home/nagios. You can set other values there also (eg, '-e PYTHONPATH=/path/to').
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Wed Jun 20, 2018 9:05 am Post subject: |
|
|
here is the init script:
Code: | #!/sbin/openrc-run
# This is a custom variable, and has the following default value if a
# specific config file is not defined by the user.
: ${NAGIOS_CONFIG:="/etc/nagios/nagios.cfg"}
# These two facilitate the bindir variable substitution below.
prefix=/usr
exec_prefix=${prefix}
# The rest are OpenRC variables.
extra_commands="checkconfig"
extra_started_commands="reload"
# We put "--daemon" in command_args and not command_args_background
# because the latter interacts weirdly with the config file argument.
command="/usr/sbin/nagios"
command_args="--daemon ${NAGIOS_CONFIG}"
pidfile="/var/nagios/nagios.lock"
depend(){
# Most daemons don't really *need* the network; they're happy with
# the loopback interface. However, nagios might start generating
# "EVERYTHING IS DOWN" alerts if it starts before the real live
# network comes up.
need net
use logger
after mysql postgresql
}
reload(){
checkconfig || return $?
ebegin "Reloading configuration"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}
checkconfig(){
ebegin "Verifying config files"
# Save the output in case verification fails and errors are printed.
OUTPUT=$( ${command} --verify-config "${NAGIOS_CONFIG}" )
# Save the exit code from the verification so that `echo` doesn't
# clobber it. Then, if verification failed, show its
# output. Otherwise, succeed quietly.
local exit_code=$?
[ $exit_code -ne 0 ] && echo "${OUTPUT}" >&2
eend $exit_code
}
start_pre() {
# Without this, the "start" action will appear to succeed even if
# the config file contains errors, and the daemon fails to start.
# Another approach would be to wait for the PID file to appear, but
# this is fast enough and feels cleaner.
checkconfig || return $?
}
stop_pre() {
# If this is a restart, check to make sure the user's config
# isn't busted before we stop the running daemon.
if [ "${RC_CMD}" = "restart" ] ; then
checkconfig || return $?
fi
} |
Quote: | You can set other values there also (eg, '-e PYTHONPATH=/path/to'). |
so where to set that? _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Jun 20, 2018 12:15 pm Post subject: |
|
|
Majed17 wrote: | here is the init script: |
Majed17 ... that doesn't seem to be the same as those in the tree:
Code: | # cat ~portdir/metadata/timestamp
Wed Jun 13 16:38:24 UTC 2018
# egrep '^start_stop_daemon' ~portdir/net-analyzer/nagios-core/files/*
/var/db/repositories/gentoo/net-analyzer/nagios-core/files/nagios3:start_stop_daemon_args="-e HOME=/var/nagios/home"
/var/db/repositories/gentoo/net-analyzer/nagios-core/files/nagios4-r1:start_stop_daemon_args="-e HOME=/var/nagios/home" |
Your package is installed from ::gentoo ... and you've run etc-update/dispatch-conf on updates?
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Fri Jun 22, 2018 9:00 am Post subject: |
|
|
nagios -v
Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL
I emerged it, modified the init script to point to where the pid actually is.
first time I see dispatch-conf. _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Jun 22, 2018 5:07 pm Post subject: |
|
|
Majed17 wrote: | I emerged it, modified the init script to point to where the pid actually is. first time I see dispatch-conf. |
Majed17 ... if I grep recursively for "NAGIOS_CONFIG" in net-analyzer it returns nothing, so I'm not sure what the source of the above initscript is. Under net-analyzer/nagios-core/files there are two initscripts, nagios3 and nagios4-r1, I'd assume you'd have the later. As for nagios-core-4.3.4.ebuild it has 'newinitd openrc-init nagios' so /etc/init.d/nagios should have come from there ... why yours is deferent I can't say, do you have another ::repo with net-analyzer/nagios-core, what does the following show:
Code: | # emerge -pv =net-analyzer/nagios-core-4.3.4 |
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Mon Jun 25, 2018 10:58 am Post subject: |
|
|
Well today someone on gentoo released the new version of nagios, so I fixed the nagios.cfg and now the init.d acript is the default.
Code: | emerge -pv =net-analyzer/nagios-core-4.4.0
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ~] net-analyzer/nagios-core-4.4.0::gentoo USE="apache2 perl web -classicui -lighttpd -vim-syntax" 0 KiB
Total: 1 package (1 reinstall), Size of downloads: 0 KiB |
it looks like so:
Code: |
#!/sbin/openrc-run
# These two facilitate the bindir variable substitution below.
prefix=/usr
exec_prefix=/usr
# This is a custom variable, and has the following default value if a
# specific config file is not defined by the user.
: ${NAGIOS_CONFIG:="/etc/nagios/nagios.cfg"}
# The rest are OpenRC variables.
extra_commands="checkconfig"
extra_started_commands="reload"
# We put "--daemon" in command_args and not command_args_background
# because the latter interacts weirdly with the config file argument.
command="/usr/sbin/nagios"
command_args="--daemon ${NAGIOS_CONFIG}"
pidfile="/run/nagios.lock"
depend(){
# Most daemons don't really *need* the network; they're happy with
# the loopback interface. However, nagios might start generating
# "EVERYTHING IS DOWN" alerts if it starts before the real live
# network comes up.
need net
use logger
after mysql postgresql
}
reload(){
checkconfig || return $?
ebegin "Reloading configuration"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}
checkconfig(){
ebegin "Verifying config files"
# Save the output in case verification fails and errors are printed.
OUTPUT=$( ${command} --verify-config "${NAGIOS_CONFIG}" )
# Save the exit code from the verification so that `echo` doesn't
# clobber it. Then, if verification failed, show its
# output. Otherwise, succeed quietly.
local exit_code=$?
[ $exit_code -ne 0 ] && echo "${OUTPUT}" >&2
eend $exit_code
}
start_pre() {
# Without this, the "start" action will appear to succeed even if
# the config file contains errors, and the daemon fails to start.
# Another approach would be to wait for the PID file to appear, but
# this is fast enough and feels cleaner.
checkconfig || return $?
}
stop_pre() {
# If this is a restart, check to make sure the user's config
# isn't busted before we stop the running daemon.
if [ "${RC_CMD}" = "restart" ] ; then
checkconfig || return $?
fi
} |
the problem is still actual _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Jun 25, 2018 12:37 pm Post subject: |
|
|
Majed17 ...
again, I don't know where that initscript is coming from:
Code: | # cat ~portdir/metadata/timestamp
Mon Jun 25 11:38:33 UTC 2018
# grep -rq NAGIOS_CONFIG ~portdir/net-analyzer | echo $?
1 |
... it's not in net-analyzer/*/files ... and the initscripts I pointed to above are now gone from the tree. So, does /etc/nagios/nagios.cfg, or /etc/conf.d/nagios, have an entry for $HOME, or offer some way of passing parameters to nagios when started?
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Mon Jun 25, 2018 1:19 pm Post subject: |
|
|
grep "$HOME" /etc/nagios/*.cfg
grep "$HOME" /etc/nagios/objects/commands/*.cfg
grep "$HOME" /etc/nagios/objects/templates/*.cfg
grep -rq NAGIOS_CONFIG /usr/portage/net-analyzer | echo $?
0
so I don't have it? _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Jun 25, 2018 3:13 pm Post subject: |
|
|
Majed17 wrote: | grep "$HOME" /etc/nagios/*.cfg
grep "$HOME" /etc/nagios/objects/commands/*.cfg
grep "$HOME" /etc/nagios/objects/templates/*.cfg[/code] |
Majed17 ... those commands are effectively useless, "$var" will be expanded to whatever string "$var" is assigned, and that string is unlikely to match anything (because it will be from your environment). It should be obvious from the above that what we are looking for is whatever method now exists for informing nagios what "$HOME" is (so, whatever has replaced 'start_stop_daemon_args="-e HOME=/var/nagios/home"'), as I said, I can't look, because none of those files exist in the tree.
BTW, that is basic unix stuff, and you should know this if you're job is to maintain "infrastructure monitoring".
Majed17 wrote: | Code: | grep -rq NAGIOS_CONFIG /usr/portage/net-analyzer | echo $?
0 |
so I don't have it? |
It's obvious you have it, you posted it above, I'm just showing you that I don't know where it, and the other config files, come from ... so I can't look and see how you might change the default location "/var/nagios/home" to "/home/nagios" ... again, basic stuff.
The poster similarly doesn't understand that the environment of a login shell is fundamentally different to the environment provided a service/daemon. The irony is that this is most likely a RHCE, and both of you should know how this works. The fact that gentoo doesn't have /etc/sysconfig is because gentoo is not redhat, and where redhat provides /etc/sysconfig gentoo has /etc/conf.d ... so what does /etc/conf.d/nagios have ... again, I can't look because those file don't exist in the tree, and I don't know where they come from.
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Tue Jun 26, 2018 6:40 am Post subject: |
|
|
Code: | grep "HOME" /etc/nagios/*.cfg
/etc/nagios/nrpe.cfg:# or $HOME/.rnd. If neither exists, the pseudo random number generator will
grep "HOME" /etc/nagios/objects/commands/*.cfg
grep "HOME" /etc/nagios/objects/templates/*.cfg |
Although I have been linuxing since 2011 but i still am like a kid who has been given a helicopter. I still am watching videos, linux for beginers when I have extra time!
I still don't get it, what is a tree? portage is a tree?
try emerging nagios and see what you get?
content of
/etc/conf.d/nagios
Code: | # Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Distributed monitoring users will want to configure here the ip/hostname of the central server.
# It will be used by submit_check_result_via_nsca.
NAGIOS_NSCA_HOST="localhost" |
_________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Jun 26, 2018 12:42 pm Post subject: |
|
|
Majed17 wrote: | Although I have been linuxing since 2011 but i still am like a kid who has been given a helicopter. I still am watching videos, linux for beginers when I have extra time! |
Majed17 ... that is not a problem, we all lacked such knowledge at some point or other, the problem is that this is your job, if you're employed to setup and maintain "infrastructure monitoring" then you should have some level of competency in the skills required to do that. I say that not so you'll feel slighted, I say it because it's increasingly common, the "market" will hire you in preference to more experienced people for reasons of cost reduction. Software cost is practically zero, and the cost of supporting that software can be offlayed on the community (providing experience/labour for nothing.) Those factors mean that there is little reason to hire experienced people, when they can hire someone with little or no experience at a lower cost ... and still get the work done.
Majed17 wrote: | I still don't get it, what is a tree? portage is a tree? |
Yes, the source tree for package maintenance/distribution, the term comes from the directory hierarchy structure which resembles a "tree" branching out from the "root" of the filesystem "/".
Looking at /etc/conf.d/nagios that variable has been dropped/removed ... you can try adding it:
/etc/conf.d/nagios: | start_stop_daemon_args="-e HOME=/home/nagios" |
... I'm not sure that will work, but it might, if it doesn't then you could edit the initscript and add/edit the following:
/etc/init.d/nagios: | command="HOME=\"/home/nagios\" /usr/sbin/nagios" |
You might also look at the manpage and see if there is a switch you can pass to set nagios home.
best ... khay |
|
Back to top |
|
|
Majed17 Guru
Joined: 31 Aug 2011 Posts: 328 Location: Minsk, Belarus
|
Posted: Tue Jun 26, 2018 1:25 pm Post subject: |
|
|
Well, I don't know anyone in this country who configures monitoring as much as. Obvious you are not living in a socialist country! Let me bring you up to date. Here, anyone who is against the system is slander as insane and they then try to make it impossible for you to find work except with the government. They then hire you with the worst salaries while bragging that they are so good to you. There is few people in this country who have my certifications and they are all working with higher salaries. We are not slaves, we don't work for free. A resolved issue gets a donation from grateful people. If what you concluded were true, then they would have hired another demonly possessed moron instead of me when the contrary happens. All impossible to solve issues get thrown at me, I keep thinking, searching, dreaming about the issue until I resolve it.
Now to the meat of the issue. Your first suggestion nailed it!
Thank you very much for your effort and patience! _________________ Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|