Open vaivars opened 8 years ago
I am getting the output as "ZBX_NOTSUPPORTED" after running the executable. My Zabbix configuration is: CentOS 6.7 Zabbix 2.2.11
Please help me in this regard.
Same problem. Zabbix agent 3.0.1 on Ubuntu 14.04.
Make sure the script is being run as the "zabbix" user.
I have Ubuntu 12.04.5 LTS with Apache/2.2.22 and ran the script as zabbix user.
I also receive ZBX_NOTSUPPORTED.
Same here, script does not work with zabbix 3.x on Centos 6.8.
I also had this error and after some digging, it turns out that I didn't have zabbix-sender installed (doh). I found some errors in /var/log/messages that tipped me off.
This ultimately fixed my issue...
yum install zabbix-sender
Same problem: CentOS release 6.6
zabbix-web-2.4.3-1.el6.noarch zabbix-2.4.3-1.el6.x86_64 zabbix-agent-2.4.3-1.el6.x86_64 zabbix-sender-2.4.3-1.el6.x86_64 zabbix-java-gateway-2.4.3-1.el6.x86_64 zabbix-server-mysql-2.4.3-1.el6.x86_64 zabbix-proxy-2.4.3-1.el6.x86_64 zabbix-get-2.4.3-1.el6.x86_64 zabbix-server-2.4.3-1.el6.x86_64 zabbix-proxy-mysql-2.4.3-1.el6.x86_64 zabbix-web-mysql-2.4.3-1.el6.noarch
I installed zabbix-sender during my troubleshooting and it did not fix it
Try with the newly applied PRs.
gpmidi commented just now Try with the newly applied PRs.
@gpmidi What PRs is?
Same issue, if I run: "/var/lib/zabbix/bin/check_apache" I get this output: ZBX_NOTSUPPORTED
@ne0trace do you have installed the packages zabbix-sender and zabbix-get?
zabbix_sender and zabbix_get command both are available
zabbix.x86_64 2.2.13-1.el6 @zabbix zabbix-agent.x86_64 2.2.13-1.el6 @zabbix zabbix-get.x86_64 2.2.13-1.el6 @zabbix zabbix-release.noarch 2.2-1.el6 installed zabbix-sender.x86_64 2.2.14-1.el6 @zabbix
@ne0trace I solve it using zapache in my zabbix server https://github.com/lorf/zapache but in my RHEL Apache, stats are not working not sure why yet. May be zapache will work for you
For the people that have been able to get it to work:
When I run it as check_apache as zabbix I don't get the ZBX_NOTSUPPORTED error but I don't get data in. When I run it as root I always get ZBX_NOTSUPPORTED.
Any ideas for me to try something new?
I'm also getting the ZBX_NOTSUPPORTED.
Looked in the logs and found:
...failed to send parsed data: error returned from /usr/bin/zabbix_sender! ret: 1, out: 'Sending failed.', err: 'zabbix_sender [369549]: ERROR: [line 1] '-' encountered as 'Hostname', but no default hostname was specified'
check_apache
script uses zabbix_sender
to transfer data to zabbix server. But there is the issue with zabbix_sender
: https://support.zabbix.com/browse/ZBXNEXT-1729.
So when we use config file, and use HostnameItem
instead of Hostname
the error occurs.
It will be helpful to add option to check_apache
script which will accep hostname.
Thanks a lot for the script & the template! Saved me some time :) I also had some issues getting it to work, so I share my experience. First of all I wrote an error output in to the script "check_apache". After that I got more information and not only "ZBX_NOTSUPPORTED". That helped a lot and I could start debugging. When I run the script from the command line I got the error, that the host/server(zabbix) can't be found on "localhost" and also an error that IPv6 support was missing. So I looked up zabbix_sender in the manual and it declares that it is not using automatically the config file from the agent. So if you run the script from the command line, do it like this:
./check_apache --config /etc/zabbix/zabbix_agentd.conf
Then I corrected my "status.conf" configuration because I am using apache 2.4 and the arguments in the readme are no longer recommended: `<Location /server-status>
SetHandler server-status
Require ip 127.0.0.1
Require ip ::1
`
So after that I put the line from the readme in the zabbix users crontab and it started working.
I ran into this issue and spent several hours debugging it. The answer for me in the end was actually really simple:
In my server-status I had this line:
Uptime: 338982
ReqPerSec: 2.41644
BytesPerSec: 132461
BytesPerReq: 54816.8
BusyWorkers: 91
IdleWorkers: 0
Scoreboard: RRKK......
TLSSessionCacheStatus
CacheType: SHMCB
CacheSharedMemory: 512000
CacheCurrentEntries: 37
CacheSubcaches: 32
But note that there is no : after TLSSessionCacheStatus. This was causing my "ZBX_NOTSUPPORTED" error as well as a "failed to parse server-status: need more than 1 value to unpack" error in the syslog.
The solution for me was to modify the check script in the parse section from:
lines=[]
for l in data:
if l.startswith('Server Built'):
continue
if l.startswith('CurrentTime'):
continue
if l.startswith('RestartTime'):
continue
lines.append(l)
data = "\n".join(lines)
To this:
lines=[]
for l in data:
if l.startswith('Server Built'):
continue
if l.startswith('CurrentTime'):
continue
if l.startswith('RestartTime'):
continue
if l.startswith('TLSSessionCacheStatus'):
continue
lines.append(l)
data = "\n".join(lines)
Now the script is working for me...
I had to add Allow from localhost at apache conf. 127.0.0.1 was not enough. I saw this from forbidden logs at syslog.
Apache Version:
Server version: Apache / 2.4.6 (CentOS)
Server built: Apr 2 2020 13: 13: 23
Server's Module Magic Number: 20120211: 24
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
MPM server: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with ....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT = 256
-D HTTPD_ROOT =" / etc / httpd "
-D SUEXEC_BIN =" / usr / sbin / suexec "
-D DEFAULT_PIDLOG =" / run / httpd / httpd.pid "
-D DEFAULT_SCOREBOARD =" logs / apache_runtime_status "
-D DEFAULT_ERRORLOG =" logs / error_log "
-D AP_TYPES_CONFIG_FILE =" conf / mime.types "
-D SERVER_CONFIG_FILE =" conf / httpd.conf "
zabbix_sender version:
zabbix_sender (Zabbix) 3.0.31
Revision 3e15255cda 27 April 2020, compilation time: Apr 27 2020 15: 15: 48
python version:
Python 2.7.5
If run:
[~] # / var / lib / zabbix / bin / check_apache --config / etc / zabbix / zabbix_agentd.conf
return:
ZBX_NOTSUPPORTED
I have been debug this script and I have see whic my Apache server-status, return four item not present in the server template:
- apache [ConnsAsyncClosing] 0
- apache [ConnsAsyncWriting] 0
- apache [ConnsTotal] 0
- apache [ConnsAsyncKeepAlive] 0
FIXED:
In the server zabbix Template I have add item for each of this values. This is the diff for the Template:
--- Template_App_Apache_Status_ori.xml 2016-09-06 20:04:39.000000000 +0200
+++ Template_App_Apache_Status.xml 2020-10-23 17:24:39.000000000 +0200
@@ -915,6 +915,174 @@
</applications>
<valuemap/>
</item>
+ <item>
+ <name>Apache - ConnsAsyncClosing</name>
+ <type>2</type>
+ <snmp_community/>
+ <multiplier>0</multiplier>
+ <snmp_oid/>
+ <key>apache[ConnsAsyncClosing]</key>
+ <delay>60</delay>
+ <history>30</history>
+ <trends>365</trends>
+ <status>0</status>
+ <value_type>3</value_type>
+ <allowed_hosts/>
+ <units>Conns</units>
+ <delta>0</delta>
+ <snmpv3_contextname/>
+ <snmpv3_securityname/>
+ <snmpv3_securitylevel>0</snmpv3_securitylevel>
+ <snmpv3_authprotocol>0</snmpv3_authprotocol>
+ <snmpv3_authpassphrase/>
+ <snmpv3_privprotocol>0</snmpv3_privprotocol>
+ <snmpv3_privpassphrase/>
+ <formula>1</formula>
+ <delay_flex/>
+ <params/>
+ <ipmi_sensor/>
+ <data_type>0</data_type>
+ <authtype>0</authtype>
+ <username/>
+ <password/>
+ <publickey/>
+ <privatekey/>
+ <port/>
+ <description/>
+ <inventory_link>0</inventory_link>
+ <applications>
+ <application>
+ <name>Apache Stats</name>
+ </application>
+ </applications>
+ <valuemap/>
+ </item>
+ <item>
+ <name>Apache - ConnsAsyncKeepAlive</name>
+ <type>2</type>
+ <snmp_community/>
+ <multiplier>0</multiplier>
+ <snmp_oid/>
+ <key>apache[ConnsAsyncKeepAlive]</key>
+ <delay>60</delay>
+ <history>30</history>
+ <trends>365</trends>
+ <status>0</status>
+ <value_type>3</value_type>
+ <allowed_hosts/>
+ <units>Conns</units>
+ <delta>0</delta>
+ <snmpv3_contextname/>
+ <snmpv3_securityname/>
+ <snmpv3_securitylevel>0</snmpv3_securitylevel>
+ <snmpv3_authprotocol>0</snmpv3_authprotocol>
+ <snmpv3_authpassphrase/>
+ <snmpv3_privprotocol>0</snmpv3_privprotocol>
+ <snmpv3_privpassphrase/>
+ <formula>1</formula>
+ <delay_flex/>
+ <params/>
+ <ipmi_sensor/>
+ <data_type>0</data_type>
+ <authtype>0</authtype>
+ <username/>
+ <password/>
+ <publickey/>
+ <privatekey/>
+ <port/>
+ <description/>
+ <inventory_link>0</inventory_link>
+ <applications>
+ <application>
+ <name>Apache Stats</name>
+ </application>
+ </applications>
+ <valuemap/>
+ </item>
+ <item>
+ <name>Apache - ConnsAsyncWriting</name>
+ <type>2</type>
+ <snmp_community/>
+ <multiplier>0</multiplier>
+ <snmp_oid/>
+ <key>apache[ConnsAsyncWriting]</key>
+ <delay>60</delay>
+ <history>30</history>
+ <trends>365</trends>
+ <status>0</status>
+ <value_type>3</value_type>
+ <allowed_hosts/>
+ <units>Conns</units>
+ <delta>0</delta>
+ <snmpv3_contextname/>
+ <snmpv3_securityname/>
+ <snmpv3_securitylevel>0</snmpv3_securitylevel>
+ <snmpv3_authprotocol>0</snmpv3_authprotocol>
+ <snmpv3_authpassphrase/>
+ <snmpv3_privprotocol>0</snmpv3_privprotocol>
+ <snmpv3_privpassphrase/>
+ <formula>1</formula>
+ <delay_flex/>
+ <params/>
+ <ipmi_sensor/>
+ <data_type>0</data_type>
+ <authtype>0</authtype>
+ <username/>
+ <password/>
+ <publickey/>
+ <privatekey/>
+ <port/>
+ <description/>
+ <inventory_link>0</inventory_link>
+ <applications>
+ <application>
+ <name>Apache Stats</name>
+ </application>
+ </applications>
+ <valuemap/>
+ </item>
+ <item>
+ <name>Apache - ConnsTotal</name>
+ <type>2</type>
+ <snmp_community/>
+ <multiplier>0</multiplier>
+ <snmp_oid/>
+ <key>apache[ConnsTotal]</key>
+ <delay>60</delay>
+ <history>30</history>
+ <trends>365</trends>
+ <status>0</status>
+ <value_type>3</value_type>
+ <allowed_hosts/>
+ <units>Conns</units>
+ <delta>0</delta>
+ <snmpv3_contextname/>
+ <snmpv3_securityname/>
+ <snmpv3_securitylevel>0</snmpv3_securitylevel>
+ <snmpv3_authprotocol>0</snmpv3_authprotocol>
+ <snmpv3_authpassphrase/>
+ <snmpv3_privprotocol>0</snmpv3_privprotocol>
+ <snmpv3_privpassphrase/>
+ <formula>1</formula>
+ <delay_flex/>
+ <params/>
+ <ipmi_sensor/>
+ <data_type>0</data_type>
+ <authtype>0</authtype>
+ <username/>
+ <password/>
+ <publickey/>
+ <privatekey/>
+ <port/>
+ <description/>
+ <inventory_link>0</inventory_link>
+ <applications>
+ <application>
+ <name>Apache Stats</name>
+ </application>
+ </applications>
+ <valuemap/>
+ </item>
</items>
<discovery_rules/>
<macros/>
After trying to run the executable i get that error.
Ubuntu 14.04, Zabbix 2.4