Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php-script: failed: 56 #21

Open
Piknik1990 opened this issue Jul 12, 2017 · 1 comment
Open

php-script: failed: 56 #21

Piknik1990 opened this issue Jul 12, 2017 · 1 comment

Comments

@Piknik1990
Copy link

Hello!

Thank for you Template of Zabbix.

I try install his in the CentOS 7 and Zabbix 3.2.

# yum install php-devel php-pear gcc make git openssl-devel
# pecl install mongo
# vi /etc/php.ini
...
extension=mongo.so

# cd /usr/lib/zabbix/externalscripts
# wget https://raw.githubusercontent.com/nightw/mikoomi-zabbix-mongodb-monitoring/master/mongodb-3.2/mikoomi-mongodb-plugin-32.sh
# wget https://raw.githubusercontent.com/nightw/mikoomi-zabbix-mongodb-monitoring/master/mongodb-3.2/mikoomi-mongodb-plugin-32.php

# chmod 755 mikoomi-mongodb-plugin-32.*

# vi /etc/crontab
...
ZABBIX_HOSTNAME=$(hostname -f)
* * * * * root /usr/lib/zabbix/externalscripts/mikoomi-mongodb-plugin-32.sh -z $ZABBIX_HOSTNAME


Download https://raw.githubusercontent.com/nightw/mikoomi-zabbix-mongodb-monitoring/master/mongodb-3.2/MongoDB_Plugin_template_export-32.xml

*Import Template*

But Web-Graphics view of "No Data" and cron logging follow messeges:
Subject: Cron root@localhost /usr/lib/zabbix/externalscripts/mikoomi-mongodb-plugin-32.sh -z $ZABBIX_HOSTNAME
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <XDG_SESSION_ID=18>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0>
X-Cron-Env: <LANG=ru_RU.UTF-8>
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <ZABBIX_HOSTNAME=$(hostname -f)>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: [email protected]
Date: Wed, 12 Jul 2017 12:22:01 +0300 (MSK)

mikoomi-mongodb-plugin-32.php: Successfully connected to mongoDB using connect string localhost:27017
mikoomi-mongodb-plugin-32.php: O: zabbix_sender [3713]: DEBUG: answer [{"response":"success","info":"processed: 0; failed: 56; total: 56; seconds spent: 0.000572"}]
mikoomi-mongodb-plugin-32.php: O: info from server: "processed: 0; failed: 56; total: 56; seconds spent: 0.000572"
mikoomi-mongodb-plugin-32.php: O: sent: 56; skipped: 0; total: 56
0

# php -v
PHP 5.4.16 (cli) (built: Nov  6 2016 00:29:02) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
# mongo -version
MongoDB shell version: 2.6.12

Tall me, what is failed in my zabbix-system?

@nightw
Copy link
Owner

nightw commented Jul 24, 2017

The Zabbix server says that all the 56 values which were sent in were wrong in some way. I only have guesses about the problem:

  • One possibility is that hostname -f az a Zabbix node name is not working for you, because you added the Host to the Zabbix server on a different name. Try to run the script manually (without Cron and use the short hostname from the Zabbiz server az a parameter to the -z command line option)
  • Maybe the values are indeed wrong (for example not collected from the MongoDB server for some reason and all of them are empty/null). You should run the command manually (the one in the Cron job) and test with the -D option and then check the resulting file in /tmp/mikoomi-mongodb-plugin.php_*.log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants