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

Tmeout while executing a shell script #42

Open
deekaysu opened this issue Jan 15, 2021 · 11 comments
Open

Tmeout while executing a shell script #42

deekaysu opened this issue Jan 15, 2021 · 11 comments

Comments

@deekaysu
Copy link

Hi,

Constantly receiving these errors within the zabbix agent log. I have configured the timeout to 30.

3092:20210115:003228.621 Failed to execute command "echo "discovery,site,,,,," | nc 127.0.0.1 8448 -q 1": Timeout while executing a shell script.
3090:20210115:003229.616 Failed to execute command "echo "discovery,wlan,,,,," | nc 127.0.0.1 8448 -q 1": Timeout while executing a shell script.
3091:20210115:003234.619 Failed to execute command "echo "discovery,uap,,vap_table,,," | nc 127.0.0.1 8448 -q 1": Timeout while executing a shell script.
3092:20210115:003628.080 Failed to execute command "echo "discovery,site,,,,," | nc 127.0.0.1 8448 -q 1": Timeout while executing a shell script.
3090:20210115:003634.100 Failed to execute command "echo "discovery,uap,,vap_table,,," | nc 127.0.0.1 8448 -q 1": Timeout while executing a shell script.
3092:20210115:004034.095 Failed to execute command "echo "discovery,uap,,vap_table,,," | nc 127.0.0.1 8448 -q 1": Timeout while executing a shell script.
3090:20210115:004035.098 Failed to execute command "echo "discovery,uap,,vwire_vap_table,,," | nc 127.0.0.1 8448 -q 1": Timeout while executing a shell script.

also, for the unifi switch there is no data being mined.

zabbix_agentd.conf file has the following line -

UserParameter=unifi.proxy[*],echo "$1,$2,$3,$4,$5,$6,$7" | nc 127.0.0.1 8448 -q 1

any pointers on how this can be resolved?

@zbx-sadman
Copy link
Owner

Try to run command directly from the shell, measure time... Increase debug level, to locate problem.

@deekaysu
Copy link
Author

Thanks for the reply. When I run the unifi_proxy script via command line, i am able to retrieve data, however, when the same script with identical config is run via zabbix agent (UserParameter), i dont have any data when viewed via the Zabbix UI. The only two pieces of information is ICMP stats on the two UAP's. As a matter of concern, USW does not have any data in the Zabbix front end.

@deekaysu
Copy link
Author

by the way i am using the passive checks template.

@deekaysu
Copy link
Author

whilst I check the status on the unifi_proxy service, the following error displayed -
Jan 19 16:56:50 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1042.
Jan 19 16:56:51 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1029.
Jan 19 16:56:51 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1029.
Jan 19 16:57:01 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1029.
Jan 19 16:57:01 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1029.
Jan 19 16:57:01 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1029.
Jan 19 16:57:01 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1029.
Jan 19 16:57:43 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1042.
Jan 19 16:57:43 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1042.
Jan 19 16:57:43 unifi_proxy[4262]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl line 1042.

@deekaysu
Copy link
Author

Any thoughts on this please?

@zbx-sadman
Copy link
Owner

zbx-sadman commented Jan 22, 2021

Why you use unifi_proxy.pl in the UserParameter?
Do you read this guide ?

@deekaysu
Copy link
Author

This is exactly what I have in the zabbix agent config file -

(1) Using netcat utility

UserParameter=unifi.proxy[*],echo "$1,$2,$3,$4,$5,$6,$7" | nc 127.0.0.1 8448 -q 1

@deekaysu
Copy link
Author

I just restarted the unifi_proxy service and this is what I see from the status -

unifi_proxy.service - LSB: Start UniFi Proxy TCP server
Loaded: loaded (/etc/init.d/unifi_proxy; generated)
Active: active (running) since Fri 2021-01-22 18:47:59 GMT; 3min 24s ago
Docs: man:systemd-sysv-generator(8)
Process: 31803 ExecStart=/etc/init.d/unifi_proxy start (code=exited, status=0/SUCCESS)
Tasks: 6 (limit: 2063)
CGroup: /system.slice/unifi_proxy.service
├─31805 /usr/bin/perl /usr/local/sbin/unifi_proxy.pl -D -C /etc/unifi_proxy/unifi_proxy.conf
├─31806 /usr/bin/perl /usr/local/sbin/unifi_proxy.pl -D -C /etc/unifi_proxy/unifi_proxy.conf
├─31807 /usr/bin/perl /usr/local/sbin/unifi_proxy.pl -D -C /etc/unifi_proxy/unifi_proxy.conf
├─31808 /usr/bin/perl /usr/local/sbin/unifi_proxy.pl -D -C /etc/unifi_proxy/unifi_proxy.conf
├─31809 /usr/bin/perl /usr/local/sbin/unifi_proxy.pl -D -C /etc/unifi_proxy/unifi_proxy.conf
└─31810 /usr/bin/perl /usr/local/sbin/unifi_proxy.pl -D -C /etc/unifi_proxy/unifi_proxy.conf

Jan 22 18:49:50 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:07 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:07 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:07 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:08 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:08 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:37 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:37 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:38 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl
Jan 22 18:50:38 raserver unifi_proxy[31803]: Use of uninitialized value in string at /usr/local/sbin/unifi_proxy.pl

@zbx-sadman
Copy link
Owner

Unfortunately i have no crystal balls, and i don't unravel Linux problems every day.

My instance just works for months & years after installation. All other cases script need to be debugged on target system if problem is caused.

@deekaysu
Copy link
Author

deekaysu commented Feb 4, 2021

Which version of Unifi MongoDB are you running?

I have version 2.6. Maybe that's the issue?

If you are running a higher version then I will upgrade MongoDB.

@zbx-sadman
Copy link
Owner

Shell script does not connect to MongoDB server. It works on UniFi Controller API.

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