ikzelf / zbxora

Zabbix Oracle monitoring plugin - replaced by zbxdb
42 stars 21 forks source link

Monitor Oracle installed on windows Host #19

Closed starlessboi closed 5 years ago

starlessboi commented 5 years ago

Hi again I have an oracle Instance installed on windows host, as far as I see, scripts are in bash and python, How can I monitor oracle on windows with zbxora, Or do you have any idea to monitor that with another tools or scripts? thanks

ikzelf commented 5 years ago

Just assign a Linux/OS X client as a machine to do the monitoring from. The databases can perfectly be monitored using a regular client connection. No need at all to run on a database server. Better from a client. For example in a RAC config .... you just need 1 single connection to monitor the database. If an instance fails, it just reconnects using the scan listener.

Groeten, Ronald Rood

Op 14 jan. 2019 om 20:03 heeft Mohammad notifications@github.com het volgende geschreven:

Hi again I have an oracle Instance installed on windows host, as far as I see, scripts are in bash and python, How can I monitor oracle on windows with zbxora, Or do you have any idea to monitor that with another tools or scripts? thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

starlessboi commented 5 years ago

Hi again thanks for your answer So you say I can use for example my Zabbix server to fully monitor my oracle DB? also, I guess, I don't need any agent installed on target DB server?

ikzelf commented 5 years ago

Correct. I do the same. I use the zabbix or the proxy server as monitoring host for the databases. Zbxdb/zbxora hardly put any load on the system so it won’t hurt. You do need to install the database drivers on that host and zbxdb does need about 24KB memory for every database that it monitors but that is seldom a problem. On the database host you could run a regular zabbix agent for OS monitoring.

Groeten, Ronald Rood

Op 15 jan. 2019 om 07:20 heeft Mohammad notifications@github.com het volgende geschreven:

Hi again thanks for your answer So you say I can use for example my Zabbix server to fully monitor my oracle DB? also, I guess, I don't need any agent installed on target DB server?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

starlessboi commented 5 years ago

Thanks as you recommended, I want to use zbxdb, instead of zbxora, can I use your nearly created template for version 4, in zbxora, for zbxdb? or should use zbxdb template?

ikzelf commented 5 years ago

they are mostly the same, for the metrics part. Still better to use the zbxdb template. unlink the zbxora template from the hosts and link the zbxdb template. You can keep the data. The self control/monitoring items are renamed to zbxdb …. Both plugins work very similar but for zbxdb I ‘encrypt’ the password. For Oracle you could also use Oracle Wallet to store the credentials making it all a bit mode secure.

On 15 Jan 2019, at 12:07, Mohammad notifications@github.com wrote:

Thanks as you recommended, I want to use zbxdb, instead of zbxora, can I use your nearly created template for version 4, in zbxora, for zbxdb? or should use zbxdb template?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ikzelf/zbxora/issues/19#issuecomment-454354804, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeUhifsJUvMLqOLHsTPvEx5idP-doF6ks5vDbZ3gaJpZM4Z_gqU.

ikzelf commented 5 years ago

Did you get your setup working for you?

amberchandel commented 4 years ago

Hi Sir I am try to install zabbix ora on my database machine itself not on zabbix host server. This is bash profile after zabbix changes.

ZBXORA PROFILES starts

HOME=/etc/zbxora echo $HOME export ZBXORA_HOME=$HOME export ZBXORA_OUT=/etc/zbxora/zbxora_out

ZBXORA PROFILES ends

export ORACLE_HOME=/data01/app1 export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin export ORACLE_SID=ndli19

after this I configured cron like this

My configuration file seems like this.

[zbxora] db_url: //10.1.63.123:1523/ndli19 username: C##CISTATS password: knowoneknows role: normal

for ASM instance role should be SYSDBA

out_dir: $HOME/zbxora_out hostname: DB_NDLI19 checks_dir: etc/zbxora_checks

site_checks: sap,ebs ##(default value which came along with this file)

site_checks: zabbix to_zabbix_method: NOzabbix_sender

if to_zabbix_method is zabbix_sender, every cycle a sender process is started

to_zabbix_args: zabbix_sender -z 127.0.0.1 -T -i ##(default value which came along with this file)

to_zabbix_args: zabbix_sender -z 10.1.61.161 -T -i

the output filename is added to to_zabbix_args

I have commented "#to_zabbix_args: zabbix_sender -z 127.0.0.1 -T -i " as it contains localhost I have replaced this line with below line. to_zabbix_args: zabbix_sender -z 10.1.61.161 -T -i this is the ip of my zabbix host server.

After all of this I am not able to search the host on zabbix console (front-end). please help.

amberchandel commented 4 years ago

hey, there is one more confusion you have written somewhere export ZBXDB_HOME=$HOME

what should be the value of "$HOME", please help

Thanx in advance

ikzelf commented 4 years ago

Hi, first, change to zbxdb. That I am maintaining. HOME is the homedirectory of the user that runs your zbxdb processes. ZBXDB_HOME is where your zbxdb configuration is stored.

Groeten, Ronald Rood

Op 12 apr. 2020 om 11:33 heeft amberchandel notifications@github.com het volgende geschreven:

 hey, there is one more confusion you have written somewhere export ZBXDB_HOME=$HOME

what should be the value of "$HOME", please help

Thanx in advance

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

Sir is it possible to run this on db server side where zabbix agent is installed? or it is mandatory to run zbxdb on server where zabbix is installed currently I have copied zbxora on db server machine where zabbix agent is running ...

ikzelf commented 4 years ago

Hi, yes, you can run from any machine you like. My best practice to do this from a client makes sure you are not putting extra load and extra software on the db servers.

If you really want to run from the db server, don’t use the account that owns the database or the database software. Use a non privileged account.

I prefer to have the least amount of installations. So I centralize the zbxdb installations on the proxy servers.

Groeten, Ronald Rood

Op 12 apr. 2020 om 13:20 heeft amberchandel notifications@github.com het volgende geschreven:

 Sir is it possible to run this on db server side where zabbix agent is installed? or it is mandatory to run zbxdb on server where zabbix is installed currently I have copied zbxora on db server machine where zabbix agent is running ...

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

Sir I did the configuration and put the cron accordingly but no logs are being shown neither I am able to check the host I have configured at zabbix frontend please guide where I am going wrong

amberchandel commented 4 years ago

Sir, I have created the c##cistats user and configured the same in configuration file. I have changed the IP configured from localhost to the Zabbix Server IP is it correct??

[zbxora] db_url: //10.1.63.123:1523/ndli19 username: C##CISTATS password: knowoneknows role: normal

for ASM instance role should be SYSDBA

out_dir: $HOME/zbxora_out hostname: DB_NDLI19 checks_dir: etc/zbxora_checks

site_checks: sap,ebs ##(default value which came along with this file)

site_checks: zabbix to_zabbix_method: NOzabbix_sender

if to_zabbix_method is zabbix_sender, every cycle a sender process is started

to_zabbix_args: zabbix_sender -z 127.0.0.1 -T -i ##(default value which came along with this file)

to_zabbix_args: zabbix_sender -z 10.1.61.161 -T -i

the output filename is added to to_zabbix_args

This is my configuration file don't know where I am going wrong?? :(

ikzelf commented 4 years ago

First start manually. zbxdb.py -c your.cfg and check the complaints.

The hostname in your.cfg should be equal to a hostname you created in zabbix.

The file created by zbxdb.py has to be sent to zabbix using zabbix_sender. That is what zbxdb_sender.py tries to do for you.

Groeten, Ronald Rood

Op 12 apr. 2020 om 13:55 heeft amberchandel notifications@github.com het volgende geschreven:

 Sir I did the configuration and put the cron accordingly but no logs are being shown neither I am able to check the host I have configured at zabbix frontend please guide where I am going wrong

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

I have not created any hostname in zabbix so far i thought that it will be created automatically

amberchandel commented 4 years ago

I tried runnig --> zbxora.py -c zbxora.DB_NDLI_19.cfg, I got following error

zbxora.py -c zbxora.DB_NDLI_19.cfg File "/etc/zbxora/bin/zbxora.py", line 479 output(HOSTNAME, ME[0] + "[uptime]", int(time.time()) - STARTTIME)) ^ SyntaxError: invalid syntax

amberchandel commented 4 years ago

Sir I have configured cron

but no data is being sent to zabbix no logs are getting printed

ikzelf commented 4 years ago

What version of python are you running? Expecting like 3.6 or newer.

The hostname creation in zabbix is not done by zbxdb.

Groeten, Ronald Rood

Op 12 apr. 2020 om 14:07 heeft amberchandel notifications@github.com het volgende geschreven:

 I tried runnig --> zbxora.py -c zbxora.DB_NDLI_19.cfg, I got following error

zbxora.py -c zbxora.DB_NDLI_19.cfg File "/etc/zbxora/bin/zbxora.py", line 479 output(HOSTNAME, ME[0] + "[uptime]", int(time.time()) - STARTTIME)) ^ SyntaxError: invalid syntax

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

Hi Sir ,

I am using Python 2.7.5 and trying to install zbxora.

I read here that it supports zbxora

ikzelf commented 4 years ago

Yes, and you need python 3. Also: zbxdb gives a bit more help when there are problems with the config. Basically it works very similar to zbxora but more robust and also supporting more vendors.

My advice: switch to zbxdb and put a newer python version in place.

Groeten, Ronald Rood

Op 12 apr. 2020 om 14:16 heeft amberchandel notifications@github.com het volgende geschreven:

 Hi Sir ,

I am using Python 2.7.5 and trying to install zbxora

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

Ok Sir I will move to zbxdb, I want to know where I am going wrong

Shall I install zbxdb at zabbix server and install oracle client for connection with database or I should install it on db server and configure zbxdb here only.

ikzelf commented 4 years ago

Preferred is on a monitoring server like zabbix server or proxy with the corresponding client software installed. The express client will do nicely. With sqlplus as extra you can easily check connectivity. Don’t install in the zabbix or root account. Create a dedicated user for zbxdb.

Groeten, Ronald Rood

Op 12 apr. 2020 om 14:24 heeft amberchandel notifications@github.com het volgende geschreven:

 Ok Sir I will move to zbxdb, I want to know where I am going wrong

Shall I install zbxdb at zabbix server and install oracle client for connection with database or I should install it on db server and configure zbxdb here only.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

Ok Sir , These will be the steps I am going to follow please correct if anything is wrong.

Instllation of latest python Installation of Oracle client creation of monitor user (user for zbxdb) download of zbxdb pasting it in /home/zbxdb folder cofiguring bash profile. HOME=/home/monitor ZBXDB_HOME=/home/monitor/zbxdb/ ZBXDB_OUT=$ZBXDB_HOME/zbxora_out export PATH=$PATH:$HOME/zbxdb/bin

after this creation opf folder

mkdir $ZBXDB_OUT mkdir $ZBXDB_HOME/log mkdir $HOME/zbxdb_sender

Adding them in cron $HOME/zbxdb/bin/zbxdb_starter > /dev/null 2>&1 $HOME/zbxdb/bin/zbxdb_sender > /dev/null 2>&1

What I have to do next after all of this steps please guide.

ikzelf commented 4 years ago

Verify by running zbxdb.py -c your.cfg If that stops complaining manually run zbxdb_sender.py and see that it is clearing the ZBXDB_OUT/ folder. Check that it is moving the files to zbxdb_sender/in, send them to zabbix and archive the files to zbxdb_sender/archive/

If this is all ok you should be able to see your data in latest data for your hostname that you created and used in your config file.

Groeten, Ronald Rood

Op 12 apr. 2020 om 14:46 heeft amberchandel notifications@github.com het volgende geschreven:

 Ok Sir , These will be the steps I am going to follow please correct if anything is wrong.

Instllation of latest python Installation of Oracle client creation of monitor user (user for zbxdb) download of zbxdb pasting it in /home/zbxdb folder cofiguring bash profile. HOME=/home/monitor ZBXDB_HOME=/home/monitor/zbxdb/ ZBXDB_OUT=$ZBXDB_HOME/zbxora_out export PATH=$PATH:$HOME/zbxdb/bin

after this creation opf folder

mkdir $ZBXDB_OUT mkdir $ZBXDB_HOME/log mkdir $HOME/zbxdb_sender

Adding them in cron $HOME/zbxdb/bin/zbxdb_starter > /dev/null 2>&1 $HOME/zbxdb/bin/zbxdb_sender > /dev/null 2>&1

What I have to do next after all of this steps please guide.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

Sir, I have one more confusion I was going through this url for setting up zbxdb/zbxora

what is being explained here cp -rp zbxdb/etc $HOME/ cp -p zbxdb/logging.json.example $HOME/etc/

waht we are achieving here?

and I hava a huge confusion in $HOME path and $ZBXDB_HOME I am not able to understand whether they will be same or they have to be different for instance you mentioned

export ZBXDB_HOME=$HOME

which means if I create a user name monitor and following above covention than HOME=/home/monitor ZBXDB_HOME=/home/monitor

or it should be like this HOME=/home/monitor ZBXDB_HOME=/home/monitor/zbxdb

Please tell which is correct because i am making mistake while setting profile

It will check the etc directory(note the lack of a leading '/') and start the configuration files named etc/zbxdb.{your_config}.cfg

what doe this means the lack of "/" please explain

image

ikzelf commented 4 years ago

This relative directory name usage assumes that you are connected as your monitor user with your current working directory in $HOME.

By copying zbxdb/etc to etc/ you make sure that the config files -and check_files- are not updated when using a new git pull.

You might want to make and keep modifications that you do not want to loose when updating from github.

ZBXDB_HOME points to $HOME this case. You can also point it to $HOME/zbxdb in which case you use the files that come directly from github. Both are fine.

Groeten, Ronald Rood

Op 12 apr. 2020 om 15:11 heeft amberchandel notifications@github.com het volgende geschreven:

 Sir, I have one more confusion I was going through this url for setting up zbxdb/zbxora

what is being explained here cp -rp zbxdb/etc $HOME/ cp -p zbxdb/logging.json.example $HOME/etc/

and I hava a huge confusion in $HOME path and $ZBXDB_HOME I am not able to understand whether they will be same or they have to be different for instance you mentioned

export ZBXDB_HOME=$HOME

which means if I create a user name monitor and following above covention than HOME=/home/monitor ZBXDB_HOME=/home/monitor

or it should be like this HOME=/home/monitor ZBXDB_HOME=/home/monitor/zbxdb

Please tell which is correct because i am makin mistake whike setting profile

It will check the etc directory(note the lack of a leading '/') and start the configuration files named etc/zbxdb.{your_config}.cfg

what doe this means I mean the lack of "/" please explain

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

ikzelf commented 4 years ago

Hee, what a silence.... are you up and running now?

Do you have recommendations for docu improvements?(I would not mind accepting a pr for better docu....)

Groeten, Ronald Rood

Op 12 apr. 2020 om 15:26 heeft Ronald ronald@ronr.nl het volgende geschreven:

This relative directory name usage assumes that you are connected as your monitor user with your current working directory in $HOME.

By copying zbxdb/etc to etc/ you make sure that the config files -and check_files- are not updated when using a new git pull.

You might want to make and keep modifications that you do not want to loose when updating from github.

ZBXDB_HOME points to $HOME this case. You can also point it to $HOME/zbxdb in which case you use the files that come directly from github. Both are fine.

Groeten, Ronald Rood

Op 12 apr. 2020 om 15:11 heeft amberchandel notifications@github.com het volgende geschreven:

 Sir, I have one more confusion I was going through this url for setting up zbxdb/zbxora

what is being explained here cp -rp zbxdb/etc $HOME/ cp -p zbxdb/logging.json.example $HOME/etc/

and I hava a huge confusion in $HOME path and $ZBXDB_HOME I am not able to understand whether they will be same or they have to be different for instance you mentioned

export ZBXDB_HOME=$HOME

which means if I create a user name monitor and following above covention than HOME=/home/monitor ZBXDB_HOME=/home/monitor

or it should be like this HOME=/home/monitor ZBXDB_HOME=/home/monitor/zbxdb

Please tell which is correct because i am makin mistake whike setting profile

It will check the etc directory(note the lack of a leading '/') and start the configuration files named etc/zbxdb.{your_config}.cfg

what doe this means I mean the lack of "/" please explain

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

No Sir, I am waiting for python upgradation and oracle client installation which will be done by other teanm. Post installation I will do the setup on zabbix server and get back to you incase I face any challenges. Thanks for replying Sir many thanx,

I will move with this profile configuration. HOME=/home/monitor/etc ZBXDB_HOME=/home/monitor/etc

ikzelf commented 4 years ago

Sorry to hear that it’s not yet working. Change to HOME=/home/monitor ZBXDB_HOME=/home/monitor

That way you use /home/monitor/etc for configuration.

You could make a local python installation using pyenv. I recommend that over installing it on the system level.

Groeten, Ronald Rood

Op 12 apr. 2020 om 17:07 heeft amberchandel notifications@github.com het volgende geschreven:

 No Sir, I am waiting for python upgradation and oracle client installation which will be done by other teanm. Post installation I will do the setup on zabbix server and get back to you incase I face any challenges. Thanks for replying Sir many thanx,

I will move with this profile configuration. HOME=/home/monitor/etc ZBXDB_HOME=/home/monitor/etc

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

Hi Sir,

I will keep you posted once installation done. can you please tell me why this eeror is coming is it due to old python version or configuration error??

./zbxora.py -c etc/zbxora.DB_NDLI_19.cfg

./zbxora.py -c etc/zbxora.DB_NDLI_19.cfg File "./zbxora.py", line 479 output(HOSTNAME, ME[0] + "[uptime]", int(time.time()) - STARTTIME)) ^ SyntaxError: invalid syntax

ikzelf commented 4 years ago

Old python version.

No worries, if I can, I will help you. Also think about how to get the docu better🙏 Thanks for your star on github.🙏

Groeten, Ronald Rood

Op 12 apr. 2020 om 17:30 heeft amberchandel notifications@github.com het volgende geschreven:

 Hi Sir,

I will keep you posted once installation done. can you please tell me why this eeror is coming is it due to old ython version on configuration error??

./zbxora.py -c etc/zbxora.DB_NDLI_19.cfg

./zbxora.py -c etc/zbxora.DB_NDLI_19.cfg File "./zbxora.py", line 479 output(HOSTNAME, ME[0] + "[uptime]", int(time.time()) - STARTTIME)) ^ SyntaxError: invalid syntax

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

amberchandel commented 4 years ago

Sir, I will post my edits for documentation once I complete this setup and start getting data and graph for monitoring. I will post the places where I find things difficult so that everyone can use this beautiful craft made by you.✌️

amberchandel commented 4 years ago

Hi Sir I have started configuration will seek your help if i get stuck my zabbix server is running on ubuntu so i have upgraded python fro,m 2.7 to 3.6

I have also installed oracle client now I am doing configuration

amberchandel commented 4 years ago

sir i am facing below issue while running python script cd /home/monitor/zbxdb/bin zbxdb.py -c etc/zbxdb.ZBXDB_NDLI_19.cfg Traceback (most recent call last): File "/home/monitor/zbxdb/bin/zbxdb.py", line 23, in import json ModuleNotFoundError: No module named 'json'

ikzelf commented 4 years ago

That is a bit funny …. Normally a “pip install json” would do the trick. Strange thing is: it is not a separate installed module in my system ….

On 14 Apr 2020, at 15:43, amberchandel notifications@github.com wrote:

sir i am facing below issue while running python script cd /home/monitor/zbxdb/bin zbxdb.py -c etc/zbxdb.ZBXDB_NDLI_19.cfg Traceback (most recent call last): File "/home/monitor/zbxdb/bin/zbxdb.py", line 23, in import json ModuleNotFoundError: No module named 'json'

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ikzelf/zbxora/issues/19#issuecomment-613450717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADZJBTUYZGKGMB6H2PI54DRMRR7VANCNFSM4GP6BKKA.

amberchandel commented 4 years ago

I tried running it on another rhel 8 env just to check whether it is running or not. but I didn't install oracle client.

File "/home/monitor/zbxdb/bin/zbxdb.py", line 36, in import sqlparse ModuleNotFoundError: No module named 'sqlparse'

is this error coming because I have not installed oracle client or again its python package issue?

ikzelf commented 4 years ago

No, that is because the sqlparse module is missing. Did you install the modules listed in requirements.txt?

amberchandel commented 4 years ago

No Sir,

I just upgraded my python version and thought rest will be done .

I am now installing all the packages mentioned in requirement.txt

but I have a confusion json is not mentioned in requirement.txt

ikzelf commented 4 years ago

Json is a standard module since python-2.6 so it should be available for you. You upgraded your python installation.... maybe you could check what happens with a local installation using pyenv and pyenv installer?

amberchandel commented 4 years ago

Sir, this command run successfully

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

after this i ran pyenv install 3.6.5 which was throwing below error

pyenv install 3.6.5 Traceback (most recent call last): File "/usr/lib/command-not-found", line 23, in import gettext ModuleNotFoundError: No module named 'gettext'

amberchandel commented 4 years ago

I run (git clone https://github.com/ikzelf/zbxdb.git) command for zbxdb cloning and it ran successfully but i dont find in which folder it has been cloned, please assist

git clone https://github.com/ikzelf/zbxdb.git Cloning into 'zbxdb'... remote: Enumerating objects: 122, done. remote: Counting objects: 100% (122/122), done. remote: Compressing objects: 100% (91/91), done. remote: Total 1885 (delta 73), reused 62 (delta 31), pack-reused 1763 Receiving objects: 100% (1885/1885), 439.25 KiB | 418.00 KiB/s, done. Resolving deltas: 100% (1239/1239), done. Checking connectivity... done.

ikzelf commented 4 years ago

To be honest, I have no idea what goes wrong. 1) as which user did you run the pyenv-installer? 2) did you edit and source the .bashrc at the end of the pyenv-installer? 3) what returns 'type pyenv' ? 4) as what user did you run pyenv install?

If you cloned zbxdb.git, the zbxdb directory is created in the directory where you started the clone in. Could be in $HOME

amberchandel commented 4 years ago

Sir, this is ubuntu env

1-: I run pyenv-installer through user named monitor which I created for zbxdb. 2-: Sir initially I didn't edit the .bashrc file but I edited after I ran "curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash" it ran with a warning.

**WARNING: seems you still have not added 'pyenv' to the load path.

Load pyenv automatically by adding

the following to ~/.bashrc:

export PATH="/home/monitor/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" monitor@NPDFINN-200-161:~/zbxdb/bin$ pyenv install 3.6.5 Traceback (most recent call last): File "/usr/lib/command-not-found", line 23, in import gettext**

3-: when i run "pyenv" on putty it returns below error-

monitor@NPDFINN-200-161:~/zbxdb/bin$ pyenv Traceback (most recent call last): File "/usr/lib/command-not-found", line 23, in import gettext ModuleNotFoundError: No module named 'gettext' monitor@NPDFINN-200-161:~/zbxdb/bin$

4-: I ran pyenv install through monitor user which i created for zbxdb.

some dependencies were failed while running the command

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

I am attaching the logs in next comment

amberchandel commented 4 years ago

this is the result after running curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

monitor@NPDFINN-200-161:~/zbxdb/bin$ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 148 100 148 0 0 293 0 --:--:-- --:--:-- --:--:-- 293 100 2454 100 2454 0 0 2267 0 0:00:01 0:00:01 --:--:-- 2396k Cloning into '/home/monitor/.pyenv'... remote: Enumerating objects: 693, done. remote: Counting objects: 100% (693/693), done. remote: Compressing objects: 100% (524/524), done. remote: Total 693 (delta 353), reused 259 (delta 77), pack-reused 0 Receiving objects: 100% (693/693), 389.37 KiB | 553.00 KiB/s, done. Resolving deltas: 100% (353/353), done. Checking connectivity... done. Cloning into '/home/monitor/.pyenv/plugins/pyenv-doctor'... remote: Enumerating objects: 11, done. remote: Counting objects: 100% (11/11), done. remote: Compressing objects: 100% (9/9), done. remote: Total 11 (delta 1), reused 2 (delta 0), pack-reused 0 Unpacking objects: 100% (11/11), done. Checking connectivity... done. Cloning into '/home/monitor/.pyenv/plugins/pyenv-installer'... remote: Enumerating objects: 16, done. remote: Counting objects: 100% (16/16), done. remote: Compressing objects: 100% (13/13), done. remote: Total 16 (delta 1), reused 8 (delta 0), pack-reused 0 Unpacking objects: 100% (16/16), done. Checking connectivity... done. Cloning into '/home/monitor/.pyenv/plugins/pyenv-update'... remote: Enumerating objects: 10, done. remote: Counting objects: 100% (10/10), done. remote: Compressing objects: 100% (6/6), done. remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0 Unpacking objects: 100% (10/10), done. Checking connectivity... done. Cloning into '/home/monitor/.pyenv/plugins/pyenv-virtualenv'... remote: Enumerating objects: 57, done. remote: Counting objects: 100% (57/57), done. remote: Compressing objects: 100% (51/51), done. remote: Total 57 (delta 11), reused 21 (delta 0), pack-reused 0 Unpacking objects: 100% (57/57), done. Checking connectivity... done. Cloning into '/home/monitor/.pyenv/plugins/pyenv-which-ext'... remote: Enumerating objects: 10, done. remote: Counting objects: 100% (10/10), done. remote: Compressing objects: 100% (6/6), done. remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0 Unpacking objects: 100% (10/10), done. Checking connectivity... done.

WARNING: seems you still have not added 'pyenv' to the load path.

Load pyenv automatically by adding

the following to ~/.bashrc:

export PATH="/home/monitor/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" monitor@NPDFINN-200-161:~/zbxdb/bin$ pyenv install 3.6.5 Traceback (most recent call last): File "/usr/lib/command-not-found", line 23, in import gettext ModuleNotFoundError: No module named 'gettext'

ikzelf commented 4 years ago

Since you are still using the systems python installation, I assume you did not add export PATH="/home/monitor/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"

to your ~/.bashrc

Add these lines to you .bashrc, logout and login again. type pyenv should give output like pyenv is a function pyenv () { local command; command="${1:-}"; if [ "$#" -gt 0 ]; then shift; fi; case "$command" in activate | deactivate | rehash | shell) eval "$(pyenv "sh-$command" "$@")" ;; *) command pyenv "$command" "$@" ;; esac }

sometimes it happens that the .bashrc is not sourced at login. In that case add the lines to your $HOME/.bash_profile

amberchandel commented 4 years ago

Sir, Ithink pyenv is working now.

on running pyenv command I git this.

monitor@NPDFINN-200-161:~$ pyenv pyenv 1.2.18 Usage: pyenv []

Some useful pyenv commands are: activate Activate virtual environment commands List all available pyenv commands deactivate Deactivate virtual environment doctor Verify pyenv installation and development tools to build pythons. exec Run an executable with the selected Python version global Set or show the global Python version(s) help Display help for a command hooks List hook scripts for a given pyenv command init Configure the shell environment for pyenv install Install a Python version using python-build local Set or show the local application-specific Python version(s) prefix Display prefix for a Python version rehash Rehash pyenv shims (run this after installing executables) root Display the root directory where versions and shims are kept shell Set or show the shell-specific Python version shims List existing pyenv shims uninstall Uninstall a specific Python version version Show the current Python version(s) and its origin --version Display the version of pyenv version-file Detect the file that sets the current pyenv version version-name Show the current Python version version-origin Explain how the current Python version is set versions List all Python versions available to pyenv virtualenv Create a Python virtualenv using the pyenv-virtualenv plugin virtualenv-delete Uninstall a specific Python virtualenv virtualenv-init Configure the shell environment for pyenv-virtualenv virtualenv-prefix Display real_prefix for a Python virtualenv version virtualenvs List all Python virtualenvs found in `$PYENV_ROOT/versions/*'. whence List all Python versions that contain the given executable which Display the full path to an executable

See `pyenv help ' for information on a specific command. For full documentation, see: https://github.com/pyenv/pyenv#readme

ikzelf commented 4 years ago

Great, then now you can install python 3.6.5 using "pyenv install 3.6.5" Next, make that version your default: "pyenv global 3.6.5" After this you can install the requirements

amberchandel commented 4 years ago

It is inatslling

monitor@NPDFINN-200-161:~$ pyenv install 3.6.5 Downloading Python-3.6.5.tar.xz... -> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz Installing Python-3.6.5...

But sir my machine already gave python 3.6 will above command will overwrite the python 3.6?

amberchandel commented 4 years ago

Sir , It got failed.

monitor@NPDFINN-200-161:~$ pyenv install 3.6.5 Downloading Python-3.6.5.tar.xz... -> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz Installing Python-3.6.5...

BUILD FAILED ( using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20200415124923.15093 Results logged to /tmp/python-build.20200415124923.15093.log

Last 10 log lines: raise subprocess.CalledProcessError(code, cmd, stdout, stderr) subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1. Makefile:1099: recipe for target 'install' failed make: *** [install] Error 2 Traceback (most recent call last): File "/usr/bin/lsb_release", line 25, in import lsb_release File "/usr/lib/python3/dist-packages/lsb_release.py", line 28, in import csv ModuleNotFoundError: No module named 'csv'

ikzelf commented 4 years ago

pyenv will install a local copy of python in your home directory. What does your PATH look like?