Hello everyone.
I create one script.sh in Host and call this script for test using Zabbix_Get in my Zabbix Server, but result it's really different and wrong.
Someone can help me to solve it?
I tried a lot of changes and nothing changes. Before I create this script .sh I tried to use this check using 'UserParameters' but in the Zabbix_Get result always empty.
Follow the configurations:
Call from zabbix server is:
In the host the sh call return OK or a message, the command is:
The expected result is message "OK" or when I have a problem message is: 'The password will expire in X days' the 'X' is a variable that I got from .sh script. When I call that script from zabbix Server I receving the message:
"The password will expire in 0 days"
But when I call that script in host the message is "OK".
When I tried to use 'UserParameters' the problem is similar, for example:
Zabbix Server call:
The result is always empty/blank.
In the host when I call the result is the days until passexpire using command:
UserParameter configuration:
Someone know what I'm doing wrong? others UsersParameters works well.
I create one script.sh in Host and call this script for test using Zabbix_Get in my Zabbix Server, but result it's really different and wrong.
Someone can help me to solve it?
I tried a lot of changes and nothing changes. Before I create this script .sh I tried to use this check using 'UserParameters' but in the Zabbix_Get result always empty.
Follow the configurations:
Call from zabbix server is:
Code:
zabbix_get -s IP_HOST -k pass.expire[operador]
Code:
/bin/sh /etc/zabbix/zabbix_agent2.d/check_pass_expire.sh operador
"The password will expire in 0 days"
But when I call that script in host the message is "OK".
When I tried to use 'UserParameters' the problem is similar, for example:
Zabbix Server call:
Code:
zabbix_get -s 10.227.67.102 -k pass.expire[operador]
In the host when I call the result is the days until passexpire using command:
getent shadow "USER" |cut -d: -f5
UserParameter=pass.expire[*],getent shadow "$1" |cut -d: -f5