C
C
chelius_ua2017-04-24 13:34:49
Python
chelius_ua, 2017-04-24 13:34:49

How to get the output of custom scripts in Zabbix?

Hello! There was a problem to install PostrgeSQL database for nomintoring, as the monitoring system was proposed by Zabbix. I found a good article on this topic https://habrahabr.ru/post/234481/
The first thing I encountered was the database itself on Windows. by small edits of the template config, we managed to make 80% friends with Windows, only those items that are built mainly on UNIX commands remained. I decided to use Python to get the necessary data. But now faced with the fact that zabbix_get does not eat print from a python script (the script measures the execution time of a command that executes in select '1').
For example, I execute zabbix_get.exe -s 127.0.0.1 -k pgsql.ping
I get empty
In my config I have UserParameter=pgsql.ping[*],C:\Zabbix\scripts\pgsql_ping.py
It's a shame to fall asleep at such a moment, given that such scripts will often need to be hung up.
When I hang up the command C:\"Program Files"\PostgreSQL\9.5\bin\psql.exe -qAtX $1 -c "select 1" in the config, it works fine in zabbix, units fly and zabbix_get through the console also shows one.
I will be grateful for your help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question