[ZBX-3553] Agent is unable to get system.hostname and system.uname Created: 2011 Feb 21  Updated: 2017 May 30  Resolved: 2011 Mar 07

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 1.8.5
Fix Version/s: 1.8.5

Type: Incident report Priority: Blocker
Reporter: Sergey Syreskin Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Custom Linux, Redhat-based, kernel version 2.4.32, glibc version 2.3.6.


Attachments: File agent.log     Text File ps.txt    
Issue Links:
Duplicate
is duplicated by ZBX-3554 Agent doesn't start if Hostname is no... Closed

 Description   

Agent fails to run hostname and uname commands. Agent log and ps auxw output attached.
sudo -u zabbix uname -a and sudo -u zabbix hostname do work.



 Comments   
Comment by Sergey Syreskin [ 2011 Feb 21 ]

Other data items seem to work ok.

Comment by Sergey Syreskin [ 2011 Feb 21 ]

Agent works on other Linux'es and Solaris.

Comment by Alexei Vladishev [ 2011 Feb 21 ]

Was the agent compiled on the same server?

Comment by Sergey Syreskin [ 2011 Feb 21 ]

May be related to https://support.zabbix.com/browse/ZBX-3554

Comment by Sergey Syreskin [ 2011 Feb 21 ]

Yes, agent was recently compiled on the same host. There were no environment changes since then.

Comment by Sergey Syreskin [ 2011 Mar 01 ]

Agent version 1.8.4 works well on this system. The problem was introduced in pre-1.8.5.

Comment by richlv [ 2011 Mar 02 ]

could you please show the output of "ls -l /bin/sh" ?
thanks

Comment by Sergey Syreskin [ 2011 Mar 02 ]

[root@trm7 zabbix]# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Дек 10 16:59 /bin/sh -> bash

Comment by Oleksii Zagorskyi [ 2011 Mar 02 ]

Richlv said that my problems may be related to this issue, so i attach here.

Latest documentation changes by Alexei:
"$0 will be substituted by the item key."
http://www.zabbix.com/documentation/1.8/manual/config/user_parameters

My userparameter from the agent config:
UserParameter=mytest[*],echo $0

I execute:
[root@mon]# zabbix_get -s 127.0.0.1 -k 'mytest[23234,rrwer,888]'
echo sh

As you see i can't receive the text "mytest", i received the "echo sh" text instead.
How i can receive "mytest" text?

How to get item key?

p.s. tested in the latest trunk and 1.8.4

Comment by Aleksandrs Saveljevs [ 2011 Mar 02 ]

Oleksiy, we had a buggy documentation. $0 is substituted by the original command ("echo $0" in your case), so Zabbix agent ends up executing "echo echo $0". Documentation has been updated.

Comment by Aleksandrs Saveljevs [ 2011 Mar 04 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-3553.

The problem seems to occur on older Linux (but not very old Linux) where WCONTINUED is defined, but not accepted by waitpid() system call. The fix is the same as in http://www.mail-archive.com/[email protected]/msg00785.html.

Comment by Sergey Syreskin [ 2011 Mar 04 ]

Thanks a lot, guys!

Comment by Aleksandrs Saveljevs [ 2011 Mar 07 ]

Fixed in pre-1.8.5 in r18266.

Generated at Fri Apr 04 10:43:26 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.