pavlovdo / pystormon

Zabbix storage monitoring via CIM/WBEM
16 stars 8 forks source link

Communication with IBM storage #10

Closed dperi7 closed 3 years ago

dperi7 commented 3 years ago

Hello,

while checking printing data from the storage via /etc/zabbix/externalscripts/pystormon/storage_cim_print.py I am getting the following: image

Can you please assist what might be the problem cause I am not getting any metrics.

Many thanks in advance Dimitris

pavlovdo commented 3 years ago

Hi, sorry for the long answer.

Probably you don't create user zabbix on your storage or set wrong password in pystormon.conf that not match with password on storage. Also check the permissions for the user zabbix on your storage - it have to be member of group RestrictedAdmin.

With best regards, Denis

dperi7 commented 3 years ago

Hello Denis and thanks for your answer,

I've made proposed changes on pystormon.conf file and now storage_cim_print.py look to work fine but still not getting any data on zabbix.

User zabbix on IBM storage has been set as administrator. Do I have to configure it as RestrictedAdmin instead?

best regards, Dimitris

pavlovdo commented 3 years ago

Hello Dimitris

You can leave user zabbix in group Administrators, it will work, but it's overpermissions for read only user. It's better to avoid grant all rights to monitoring users.

For view data in Zabbix, check that the name of your storage in devices.conf matches the name of your storage in Zabbix. Also check that Zabbix trappers is running on your Zabbix server or proxy:

# ps aux | grep trapper
zabbix    776389  0.2  0.4 2049416 111772 ?      S    дек07  63:41 /usr/sbin/zabbix_server: trapper #1 [processed data in 0.000166 sec, waiting for connection]
zabbix    776390  0.2  0.4 2049512 112016 ?      S    дек07  63:43 /usr/sbin/zabbix_server: trapper #2 [processed data in 0.000342 sec, waiting for connection]
zabbix    776391  0.2  0.4 2049452 112092 ?      S    дек07  63:12 /usr/sbin/zabbix_server: trapper #3 [processed data in 0.000301 sec, waiting for connection]
zabbix    776392  0.2  0.4 2049600 112064 ?      S    дек07  63:57 /usr/sbin/zabbix_server: trapper #4 [processed data in 0.000187 sec, waiting for connection]
zabbix    776393  0.2  0.4 2049412 111836 ?      S    дек07  63:31 /usr/sbin/zabbix_server: trapper #5 [processed data in 0.000176 sec, waiting for connection]
dperi7 commented 3 years ago

Hello Denis and thanks once more for you reply.

I have checked and verified that storage name is the same at devices.conf file and in zabbix. Also trappers are tested and running on proxy without problem. However still not getting any metrics.

Can you please clarify for me the following: 1.Should the proxy run zabbix sender ? 2.Should the proxy have an agent as well ?

  1. In Zabbix server , we defined the storwize host with the storage IP in the ‘Agent’ field , is this correct ?
  2. Communication between storage and proxy is configured as agent. Maybe I need to use SNMP interface instead?

Thanks once more for your assistance and help

Best regards Dimitris

pavlovdo commented 3 years ago

1.Should the proxy run zabbix sender ?

No;

2.Should the proxy have an agent as well ?

No;

  1. In Zabbix server , we defined the storwize host with the storage IP in the ‘Agent’ field , is this correct ?

Yes, correct;

  1. Communication between storage and proxy is configured as agent. Maybe I need to use SNMP interface instead?

No, you shouldn't use SNMP;

Did you set correct IP or FQDN of zabbix proxy (server) in pystormon.conf ? Did you run python scripts on the zabbix proxy (server) ?

dperi7 commented 3 years ago

Yes I have set the correct IP of proxy within pystormon.conf. I will try to use FQDn instead and check if something changed.

As far as I remember I have ran python scripts on proxy and were running fine. Can you please provide me the command just to be sure that I used the correct one and to test scripts once more?

Regards Dimitris

pavlovdo commented 3 years ago

Hi, Dimitris

I added printing of response from Zabbix. Please git pull last changes from pystormon github repo, enable printing = True in pystormon.conf, and try to run python scripts. If you have right config and have access to zabbix proxy/server, and storage names matches, you'll see a message like this:

Status of sending data to zabbix:
 {"processed": 8, "failed": 0, "total": 8, "time": "0.000205", "chunk": 1}
dperi7 commented 3 years ago

Hello again Denis,

thanks for your reply.

I made what you mentioned on your last message and i am getting the following meaning that communication between storage and proxy is established successfully. However no metrics yet received......

image

pavlovdo commented 3 years ago

Hello

Did you config zabbix proxy according to https://www.zabbix.com/documentation/current/manual/distributed_monitoring/proxies ? And set flag "Monitored by proxy" in zabbix for your storage host ? Did you check connection between zabbix server and proxy ?

dperi7 commented 3 years ago

Hello again Denis,

yesterday i replaced the scripts within pystormon with the latest ones that you uplaoded couple of days ago. I ran each one on proxy and I received data on zabbix but only for the corrsponding time interval as you can see on the below screenshot.

Scripts are supposed to be executed and run periodically so to receive new data each time. However I am not getting any new data apart from those I received during manual execution of scripts.

Is it something that I am making wrong?

image

pavlovdo commented 3 years ago

Hello, Dimitris

Do you run scripts from host machine or from Docker container ? Is lact check column in zabbix not updating when scripts run from cron jobs ? Is the time in the column always the same when use only cron jobs ?

dperi7 commented 3 years ago

Hello Denis,

I want to run scripts from proxy. regarding cron jobs are the following that I have to run? image

The time in the columns is always the same.

dperi7 commented 3 years ago

I ran cron jobs that I've sent you on my last message and now I am getting the below on zabbix latest data and the time changes every one minute

image

image

pavlovdo commented 3 years ago

Could you show output of command: crontab -l ?

dperi7 commented 3 years ago

image

Is that correct????

pavlovdo commented 3 years ago

Yes, that's corect. Is proccess cron running ? Are there lines about run of scripts in /var/log/cron ?

dperi7 commented 3 years ago

Only the below image

pavlovdo commented 3 years ago
  1. Do you start crond service ?
  2. Do you see lines in file /var/log/cron like: Jan 15 13:10:01 eye CROND[1461]: (root) CMD (/etc/zabbix/externalscripts/pystormon/storage_perfomance.py) ?
dperi7 commented 3 years ago

No, I dont have such folder within log and I am seeing only the files that i've sent you before. How can I start crond service?

pavlovdo commented 3 years ago
  1. CentOS/RHEL: systemctl start crond Ubuntu/Debian: systemctl start cron

  2. /var/log/cron - it's file, not folder

dperi7 commented 3 years ago

crond service started and the only cron file generated is the following one

image

pavlovdo commented 3 years ago

Could you open this file and find lines like: Jan 15 13:10:01 wblproxy CROND[1461]: (root) CMD (/etc/zabbix/externalscripts/pystormon/storage_perfomance.py) ?

dperi7 commented 3 years ago

image

pavlovdo commented 3 years ago

Please do this:

chmod +x /etc/zabbix/externalscripts/pystormon/*.py

After that check the lines in /var/log/cron and check the data in zabbix

dperi7 commented 3 years ago

Worked fine Denis!!!

pavlovdo commented 3 years ago

Super ! :+1:

dperi7 commented 3 years ago

Thanks a lot for your time and valuable help!!!!

pavlovdo commented 3 years ago

You are welcome ! :)

dperi7 commented 3 years ago

Just one final question, now that you will close the issue can I access again the comments in the future in case that I will need to remember something?

pavlovdo commented 3 years ago

Yes, of course, comments will be available while github running :)

pavlovdo commented 3 years ago

Resolved

pavlovdo commented 3 years ago

Resolved