-
Артём Мамзиков
- Admin
- Сообщения: 696
- Стаж: 3 года 11 месяцев
- Откуда: Вологодская область
- Поблагодарили: 25 раз
- Контактная информация:
Не получается запустить скрипт для выполнения задания в планировщике Windows 10
Сообщение
Артём Мамзиков » Пн мар 14, 2022 19:11 #2
Луиджи Малербо, Добрый день!
В конфигурации Заббикс Агента
Нужно раскомментировать строку EnableRemoteCommands = 1, иначе агент не сможет принимать команды.
начиная с Zabbix 5.0 system.run
Параметр EnableRemoteCommands теперь устарел.
Удаленные команды по-прежнему отключены по умолчанию, но в новых конфигурационных файлах, которые выражаются с помощью нового параметра DenyKey (DenyKey=system.run[*]) черный список,
разрешить все AllowKey=system.run[*].
Удаленные команды можно включить, удалив (или закомментировав) ключ DenyKey=system.run[*]
# — Это комментарий отключает данную настройку (данная строка не используется)
Что вам нужно сделать
#DenyKey=system.run[*]
AllowKey=system.run[*]
После перезапускаете службу заббикс агента
Возможно еще нет доступа от имени пользователя которого работает заббикс агент до планировщика событий (не хватает прав)
количество слов: 24
-
MrPrayMarh
- Гость
- Сообщения: 4
- Стаж: 2 месяца
Не получается запустить скрипт для выполнения задания в планировщике Windows 10
Сообщение
MrPrayMarh » Ср ноя 23, 2022 06:40 #5
К вопросу запуска скрипта у меня ошибка на агенте:
[15219]: FAILED SU (to zimbra) zabbix on none
[15334]: pam_unix(su-l:auth): auth could not identify password for [zimbra]
[15334]: pam_succeed_if(su-l:auth): requirement «uid >= 1000» not met by user «zimbra»
[15334]: FAILED SU (to zimbra) zabbix on none
[15484]: pam_unix(su-l:auth): auth could not identify password for [zimbra]
[15484]: pam_succeed_if(su-l:auth): requirement «uid >= 1000» not met by user «zimbra»
[15484]: FAILED SU (to zimbra) zabbix on none
[15569]: pam_unix(su-l:auth): auth could not identify password for [zimbra]
[15569]: pam_succeed_if(su-l:auth): requirement «uid >= 1000» not met by user «zimbra»
[15569]: FAILED SU (to zimbra) zabbix on none
Подскажите в какую сторону смотреть??
количество слов: 116
-
MrPrayMarh
- Гость
- Сообщения: 4
- Стаж: 2 месяца
Не получается запустить скрипт для выполнения задания в планировщике Windows 10
Сообщение
MrPrayMarh » Ср ноя 23, 2022 09:45 #7
Артём Мамзиков писал(а): ↑Ср ноя 23, 2022 08:20
MrPrayMarh, Агент запустить под пользователем root , либо выдать соответствующие права пользователю заббикс. Команду su прописать с — что бы все переменные подтянулись su- zimbra .
Код: Выделить всё
19551:20221122:140813.012 Starting Zabbix Agent [Zimbra]. Zabbix 5.0.10 (revision 7c3f43904c).
19551:20221122:140813.012 **** Enabled features ****
19551:20221122:140813.012 IPv6 support: YES
19551:20221122:140813.012 TLS support: YES
19551:20221122:140813.012 **************************
19551:20221122:140813.012 using configuration file: /etc/zabbix/zabbix_agentd.conf
19551:20221122:140813.012 agent #0 started [main process]
19552:20221122:140813.013 agent #1 started [collector]
19553:20221122:140813.013 agent #2 started [listener #1]
19554:20221122:140813.014 agent #3 started [listener #2]
19556:20221122:140813.014 agent #5 started [active checks #1]
19555:20221122:140813.018 agent #4 started [listener #3]
19553:20221122:141306.180 Failed to execute command "su - zimbra -c "zmclamdctl status"": Timeout while executing a shell script.
19555:20221122:141307.792 Failed to execute command "su - zimbra -c "mailq"|grep Request |awk '{print $5}'": Timeout while executing a shell script.
19554:20221122:141308.385 Failed to execute command "su - zimbra -c "zmlogswatchctl status"": Timeout while executing a shell script.
19555:20221122:141311.389 Failed to execute command "su - zimbra -c "zmproxyctl status"": Timeout while executing a shell script.
19553:20221122:141312.615 Failed to execute command "su - zimbra -c "zmsaslauthdctl status"": Timeout while executing a shell script.
19554:20221122:141312.745 Failed to execute command "su - zimbra -c "zmspellctl status"": Timeout while executing a shell script.
19555:20221122:141404.051 Failed to execute command "su - zimbra -c "zmapachectl status"": Timeout while executing a shell script.
19553:20221122:141405.556 Failed to execute command "su - zimbra -c "zmauditswatchctl status"": Timeout while executing a shell script.
19553:20221122:141459.129 Failed to execute command "su - zimbra -c "/opt/zimbra/bin/zmcontrol status"| grep -v ^Host| sed -e 's/^t*//g'": Timeout while executing a shell script.
19553:20221122:141601.036 Failed to execute command "su - zimbra -c "/opt/zimbra/bin/zmstatctl status"": Timeout while executing a shell script.
19555:20221122:141814.111 Failed to execute command "su - zimbra -c "zmstorectl status"": Timeout while executing a shell script.
19554:20221122:141815.184 Failed to execute command "su - zimbra -c "zmswatchctl status"": Timeout while executing a shell script.
19554:20221122:141857.868 Failed to execute command "su - zimbra -c "mailq"|grep Request |awk '{print $5}'": Timeout while executing a shell script.
19555:20221122:141859.002 Failed to execute command "su - zimbra -c "/opt/zimbra/bin/zmcontrol status"| grep -v ^Host| sed -e 's/^t*//g'": Timeout while executing a shell script.
19554:20221122:141900.870 Failed to execute command "su - zimbra -c "/opt/zimbra/bin/zmstatctl status"": Timeout while executing a shell script.
19553:20221122:141905.294 Failed to execute command "su - zimbra -c "zmauditswatchctl status"": Timeout while executing a shell script.
19555:20221122:141906.474 Failed to execute command "su - zimbra -c "zmclamdctl status"": Timeout while executing a shell script.
19554:20221122:141908.045 Failed to execute command "su - zimbra -c "zmlogswatchctl status"": Timeout while executing a shell script.
19553:20221122:141910.701 Failed to execute command "su - zimbra -c "zmproxyctl status"": Timeout while executing a shell script.
19554:20221122:141911.851 Failed to execute command "su - zimbra -c "zmsaslauthdctl status"": Timeout while executing a shell script.
19555:20221122:141913.012 Failed to execute command "su - zimbra -c "zmspellctl status"": Timeout while executing a shell script.
19553:20221122:141913.702 Failed to execute command "su - zimbra -c "zmstorectl status"": Timeout while executing a shell script.
19553:20221122:142503.706 Failed to execute command "su - zimbra -c "zmapachectl status"": Timeout while executing a shell script.
19555:20221122:142514.717 Failed to execute command "su - zimbra -c "zmswatchctl status"": Timeout while executing a shell script.
19555:20221122:142900.850 Failed to execute command "su - zimbra -c "/opt/zimbra/bin/zmstatctl status"": Timeout while executing a shell script.
19554:20221122:142905.167 Failed to execute command "su - zimbra -c "zmauditswatchctl status"": Timeout while executing a shell script.
19553:20221122:142906.324 Failed to execute command "su - zimbra -c "zmclamdctl status"": Timeout while executing a shell script.
19555:20221122:142908.179 Failed to execute command "su - zimbra -c "zmlogswatchctl status"": Timeout while executing a shell script.
19553:20221122:142911.140 Failed to execute command "su - zimbra -c "zmproxyctl status"": Timeout while executing a shell script.
19555:20221122:142911.727 Failed to execute command "su - zimbra -c "zmsaslauthdctl status"": Timeout while executing a shell script.
19554:20221122:142912.927 Failed to execute command "su - zimbra -c "zmspellctl status"": Timeout while executing a shell script.
19553:20221122:142914.148 Failed to execute command "su - zimbra -c "zmstorectl status"": Timeout while executing a shell script.
19555:20221122:142914.729 Failed to execute command "su - zimbra -c "zmswatchctl status"": Timeout while executing a shell script.
19554:20221122:142958.274 Failed to execute command "su - zimbra -c "mailq"|grep Request |awk '{print $5}'": Timeout while executing a shell script.
19555:20221122:142959.290 Failed to execute command "su - zimbra -c "/opt/zimbra/bin/zmcontrol status"| grep -v ^Host| sed -e 's/^t*//g'": Timeout while executing a shell script.
19553:20221122:143104.013 Failed to execute command "su - zimbra -c "zmapachectl status"": Timeout while executing a shell script.
19556:20221122:143613.547 no active checks on server [1**.***.**.**:10051]: host [Zimbra] not found
19556:20221122:143813.635 no active checks on server [1**.***.**.**:10051]: host [Zimbra] not found
19555:20221122:144701.660 Failed to execute command "su - zimbra -c "/opt/zimbra/bin/zmstatctl status"": Timeout while executing a shell script.
19554:20221122:144811.867 Failed to execute command "su - zimbra -c "zmsaslauthdctl status"": Timeout while executing a shell script.
Агент под рутом запущен, выше это логи агента с зимбры, если посмотреть статус службы агента на почтовике то видим:
Код: Выделить всё
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2022-11-23 16:26:48 +10; 10min ago
Process: 26149 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 26285 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 26287 (zabbix_agentd)
CGroup: /system.slice/zabbix-agent.service
├─26287 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
├─26288 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
├─26289 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
├─26290 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
├─26291 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
└─26292 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Nov 23 16:35:29 *** su[28838]: FAILED SU (to zimbra) zabbix on none
Nov 23 16:35:38 *** su[28872]: pam_unix(su-l:auth): auth could not identify password for [zimbra]
Nov 23 16:35:38 *** su[28872]: pam_succeed_if(su-l:auth): requirement "uid >= 1000" not met by user "zimbra"
Nov 23 16:35:40 *** su[28872]: FAILED SU (to zimbra) zabbix on none
Nov 23 16:36:28 *** su[29077]: pam_unix(su-l:auth): auth could not identify password for [zimbra]
Nov 23 16:36:28 *** su[29077]: pam_succeed_if(su-l:auth): requirement "uid >= 1000" not met by user "zimbra"
Nov 23 16:36:29 *** su[29077]: FAILED SU (to zimbra) zabbix on none
Nov 23 16:37:28 *** su[29319]: pam_unix(su-l:auth): auth could not identify password for [zimbra]
Nov 23 16:37:28 *** su[29319]: pam_succeed_if(su-l:auth): requirement "uid >= 1000" not met by user "zimbra"
Nov 23 16:37:30 *** su[29319]: FAILED SU (to zimbra) zabbix on none
количество слов: 1228
-
MrPrayMarh
- Гость
- Сообщения: 4
- Стаж: 2 месяца
Не получается запустить скрипт для выполнения задания в планировщике Windows 10
Сообщение
MrPrayMarh » Ср ноя 23, 2022 10:38 #9
Артём Мамзиков писал(а): ↑Ср ноя 23, 2022 10:22
MrPrayMarh, если вручную выполнить команду из под root
su — zimbra -c «zmclamdctl status» она выполняется ? И как быстро она выполняется?
И почему то пишет что ей нужен пароль от пользователя zimbra если он задан необходимо добавить переменную с паролем в команды.
Вручную команда выполняется, не сказать что быстро, но выполняется. Пароль для пользователя zimbra задан. Т.е. в шаблоне помимо $USER_ZIMBRA нужно ввести $PASS_ZIMBRA ?
количество слов: 17
-
Артём Мамзиков
- Admin
- Сообщения: 696
- Стаж: 3 года 11 месяцев
- Откуда: Вологодская область
- Поблагодарили: 25 раз
- Контактная информация:
Не получается запустить скрипт для выполнения задания в планировщике Windows 10
Сообщение
Артём Мамзиков » Ср ноя 23, 2022 10:54 #10
MrPrayMarh, да все верно , если есть пароль добавляй везде в скрипте переменную пароля , так же в элементах в шаблоне где используется аналогичная команда , добавь макросом.
Время ожидания выполнения команды максимум 30 секунд задается в конфиге заббикс сервера. По умолчанию вроде 10 секунд. Если команда выполняется дольше 30 можно сделать траппером. В некоторых случаях получаются рваные график. И ложные срабатывания триггеров если команда выполняется более 30 секунд сказывается на весь узел всле элементы типа заббикс агент.
количество слов: 5
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
Closed
astatinede opened this issue
Nov 15, 2016
· 5 comments
Comments
Hallo,
first thank you very much for the super template.
I have followed the guide and all the files installed.
But when i tried to test the command » zabbix_get -s 127.0.0.1 -k «custom.vfs.discover_disks»»,
i got
ZBX_NOTSUPPORTED: Unsupported item key.
Would you please tell me how to solve the problem?
My Sever is running debian and zabbix 2.4. Just upgraded from 2.2
Thanks.
Hello, @astatinede!
I would recommend checking the correctness of installation of userparameter_diskstats.conf. Did you put it to the correct directory?
If you’re sure that you did, then have you restarted Zabbix after that? Also you can try to inspect logs at /var/logs/zabbix or something like that.
Thank you for your feedback.
I checked again, the userparameter_diskstats.conf file is under the new created /etc/zabbix/zabbix_agentd.d.
I also found another default path /etc/zabbix/zabbix_agentd.conf.d I did move the conf file to this path and tested again. Still get notsupported.
Below is the output from zabbix_server.log after restart. Seems everthing good.
Would you please tell me how can I check if zabbix server has loaded the userparameter_diskstats.conf successfully? Or how can I configure Zabbix enforce to load the conf?
8069:20161117:083249.509 Starting Zabbix Server. Zabbix 2.4.8 (revision 59539).
8069:20161117:083249.509 ****** Enabled features ******
8069:20161117:083249.509 SNMP monitoring: YES
8069:20161117:083249.509 IPMI monitoring: NO
8069:20161117:083249.509 WEB monitoring: YES
8069:20161117:083249.509 VMware monitoring: YES
8069:20161117:083249.509 Jabber notifications: NO
8069:20161117:083249.509 Ez Texting notifications: YES
8069:20161117:083249.509 ODBC: NO
8069:20161117:083249.509 SSH2 support: NO
8069:20161117:083249.509 IPv6 support: YES
8069:20161117:083249.509 ******************************
8069:20161117:083249.509 using configuration file: /usr/local/etc/zabbix_server.conf
8069:20161117:083249.517 current database version (mandatory/optional): 02040000/02040000
8069:20161117:083249.517 required mandatory version: 02040000
8069:20161117:083249.550 server #0 started [main process]
8071:20161117:083249.551 server #1 started [configuration syncer #1]
8072:20161117:083249.551 server #2 started [db watchdog #1]
8073:20161117:083249.551 server #3 started [poller #1]
8074:20161117:083249.552 server #4 started [poller #2]
8075:20161117:083249.552 server #5 started [poller #3]
8076:20161117:083249.553 server #6 started [poller #4]
8077:20161117:083249.553 server #7 started [poller #5]
8078:20161117:083249.553 server #8 started [unreachable poller #1]
8079:20161117:083249.554 server #9 started [trapper #1]
8080:20161117:083249.554 server #10 started [trapper #2]
8081:20161117:083249.554 server #11 started [trapper #3]
8083:20161117:083249.555 server #13 started [trapper #5]
8085:20161117:083249.556 server #15 started [alerter #1]
8086:20161117:083249.556 server #16 started [housekeeper #1]
8087:20161117:083249.556 server #17 started [timer #1]
8088:20161117:083249.557 server #18 started [http poller #1]
8082:20161117:083249.560 server #12 started [trapper #4]
8094:20161117:083249.560 server #24 started [escalator #1]
8093:20161117:083249.562 server #23 started [history syncer #4]
8090:20161117:083249.566 server #20 started [history syncer #1]
8084:20161117:083249.566 server #14 started [icmp pinger #1]
8095:20161117:083249.567 server #25 started [proxy poller #1]
8096:20161117:083249.567 server #26 started [self-monitoring #1]
8091:20161117:083249.567 server #21 started [history syncer #2]
8092:20161117:083249.568 server #22 started [history syncer #3]
8089:20161117:083249.571 server #19 started [discoverer #1]
Ha, problem solved.
I added Include=/etc/zabbix/zabbix_agentd.d/ in zabbix_agentd.conf and restarted zabbix_agentd
Thanks for the tipps.
I was just going to ask you to check this configuration file.
Glad it worked!
Just wanted to add
The Include Option in /etc/zabbix/zabbix_agentd.conf hast to be:
Include=/etc/zabbix/zabbix_agentd.d/
not
Include=/etc/zabbix/zabbix_agentd.d/*.conf
Theoretically they should both work, but sadly didnt.
Hi gurus. Many thanks in advance for any assistance you can provide.
Running Zabbix server 5.0.2.
I have created a few templates to monitor aspects of Windows clients running active agents. Some of the items in these template use PowerShell scripts to collect data and send it back to the server via the sender.
I set these items up using Log as the Type and the key syntax like this:
system.run*[powershell.exe -NoProfile -ExecutionPolicy Bypass -file «%programfiles%Zabbix Agentpluginscheck-sec2020.ps1»,nowait]*
These all worked perfectly in Agent version 4.4.5. However, when I installed the newer agents (eg 5.0.2) I started getting errors saying «Unsupported item key». Here is the full error with the item and the error as logged in the zabbix_agentd.log:
80008:20200727:155320.336 active check «system.run[powershell.exe -NoProfile -ExecutionPolicy Bypass -file «%programfiles%Zabbix Agentpluginscheck-sec2020.ps1″,nowait]» is not supported: Unsupported item key.
I have confirmed this is a version issue by downgrading the agent. Once downgraded, the scripts run correctly. Does anyone know why this would stop working in newer version of the agent?
Again, thanks for any insight you may be able to provide.
Asked
3 years, 3 months ago
Viewed
6k times
I am using zabbix 4.0.
Trying to make discovery with simple check.
When i click «check now», i get Unsupported item key warning. Below you can find my discovery configuration. I couldnt solve why does it give this error. Everything seems fine.
asked Oct 9, 2019 at 23:04
It fails because you have set a Simple Check
type, then typed in a ssh.run...
key.
SSH checks type must be configured as SSH Agent
, which also enables the executed script
box: this command must return a json formatted according to the LLD format.
answered Oct 10, 2019 at 10:55
Simone ZabberoniSimone Zabberoni
1,9831 gold badge9 silver badges15 bronze badges
0
The key items to verify are:
- the feature is supported for passive checks only
- the check must be present in configuration cache in order to get executed
To refresh the configuration cache, execute zabbix_server -R config_cache_reload
(or zabbix_proxy -R config_cache_reload
).
Reference: check_now.
answered Oct 10, 2019 at 7:09
Iron BishopIron Bishop
1,6321 gold badge6 silver badges16 bronze badges
During ZABBIX monitoring, you will be prompted: Unsupported item key, which generally has the following reasons.
1. Sometimes user-defined scripts are used for monitoring. After zabix-agentd.conf is modified, it is not restarted, so an error will be reported
solution: restart ZABBIX agent
service zabbix-agent restart
2. Check whether your monitoring window is open
When using ZABBIX to monitor the server, the ZABBIX agent communicates with the ZABBIX server through port 10050. The server listens on port 10051 and the client listens on port 10050, so we need to expose the port. Sometimes, the server does not open port 10050, resulting in an error.
netstat -lntup
3. If the firewall is not closed, you need to check whether the port of the firewall and the security group on the cloud service allow the port to be opened to the outside world
4. If it is a self-defined monitoring item, you need to check whether to add the corresponding value in the configuration file of ZABBIX agent
For example, the corresponding script information, otherwise the data cannot be transmitted to the server through the agent
1 UserParameter=ora.tab.discovery,C:scriptsAutodiscoverTBS.bat 2 UserParameter=tablespace[*],C:scriptsCheckORATBS.bat $1 $2
5. Zabbix_agentd version compatibility causes the failure of item_key not to support.
It may be that the two port versions are inconsistent due to the upgrade of the client or the server, which may cause errors.
Resolve the version; upgrade the client or server to the same version
6, zabbix_get can get the value, but the item is still Not Supported. If your value type setting is correct, there are the following solutions:
—A. Wait 10 minutes, zabbix will recheck the Supported status of the current item.
—B. Delete the current item and recreate it
—c. Modify the recheck time of zabbix, for example, change it to 10 minutes, click administration—>General—>the drop-down bar on the right and select “other”—>Refresh unsupported items (in sec) Change to 60 (in seconds) —->update.