Содержание
- The Wiert Corner – irregular stream of stuff
- Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests
- Subscribe
- Archives
- Recent Comments
- Recent Posts
- Blog Stats
- Meta title
- Tag Cloud Title
- Top Clicks
- Top Posts
- My badges
- Twitter Updates
- My Flickr Stream
- Pages
- All categories
- Email Subscription
- zabbix on Windows: check the configuration before restarting the Zabbix Agent service
- Учим zabbix-agent «есть» на ходу и не давиться пользовательскими параметрами (UserParameter)
- Как же не стать параноиком и при этом не сломать zabbix-agent?
- Пример настройки на Linux
- Zabbix Agent User Parameters
- Contents
- Introduction
- Zabbix agent
- User parameters
- Creating user parameters
- Adding new items
- Results
- Conclusion
The Wiert Corner – irregular stream of stuff
Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests
Subscribe
September 2019
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
Archives
- January 2023 (11)
- December 2022 (33)
- November 2022 (26)
- October 2022 (23)
- September 2022 (25)
- August 2022 (24)
- July 2022 (26)
- June 2022 (26)
- May 2022 (23)
- April 2022 (32)
- March 2022 (69)
- February 2022 (63)
- January 2022 (66)
- December 2021 (75)
- November 2021 (66)
- October 2021 (64)
- September 2021 (67)
- August 2021 (69)
- July 2021 (69)
- June 2021 (69)
- May 2021 (68)
- April 2021 (67)
- March 2021 (72)
- February 2021 (63)
- January 2021 (65)
- December 2020 (70)
- November 2020 (64)
- October 2020 (68)
- September 2020 (67)
- August 2020 (67)
- July 2020 (71)
- June 2020 (68)
- May 2020 (64)
- April 2020 (67)
- March 2020 (70)
- February 2020 (61)
- January 2020 (74)
- December 2019 (70)
- November 2019 (63)
- October 2019 (73)
- September 2019 (68)
- August 2019 (66)
- July 2019 (68)
- June 2019 (68)
- May 2019 (72)
- April 2019 (73)
- March 2019 (64)
- February 2019 (68)
- January 2019 (78)
- December 2018 (87)
- November 2018 (77)
- October 2018 (79)
- September 2018 (77)
- August 2018 (76)
- July 2018 (74)
- June 2018 (63)
- May 2018 (70)
- April 2018 (63)
- March 2018 (72)
- February 2018 (48)
- January 2018 (83)
- December 2017 (67)
- November 2017 (62)
- October 2017 (63)
- September 2017 (52)
- August 2017 (62)
- July 2017 (48)
- June 2017 (57)
- May 2017 (68)
- April 2017 (55)
- March 2017 (59)
- February 2017 (58)
- January 2017 (60)
- December 2016 (59)
- November 2016 (74)
- October 2016 (61)
- September 2016 (87)
- August 2016 (57)
- July 2016 (51)
- June 2016 (49)
- May 2016 (48)
- April 2016 (51)
- March 2016 (49)
- February 2016 (50)
- January 2016 (48)
- December 2015 (59)
- November 2015 (57)
- October 2015 (37)
- September 2015 (31)
- August 2015 (41)
- July 2015 (31)
- June 2015 (37)
- May 2015 (30)
- April 2015 (32)
- March 2015 (37)
- February 2015 (52)
- January 2015 (50)
- December 2014 (43)
- November 2014 (39)
- October 2014 (40)
- September 2014 (41)
- August 2014 (58)
- July 2014 (32)
- June 2014 (23)
- May 2014 (38)
- April 2014 (105)
- March 2014 (145)
- February 2014 (81)
- January 2014 (56)
- December 2013 (58)
- November 2013 (32)
- October 2013 (26)
- September 2013 (26)
- August 2013 (54)
- July 2013 (47)
- June 2013 (41)
- May 2013 (33)
- April 2013 (41)
- March 2013 (50)
- February 2013 (47)
- January 2013 (55)
- December 2012 (32)
- November 2012 (23)
- October 2012 (37)
- September 2012 (52)
- August 2012 (46)
- July 2012 (40)
- June 2012 (30)
- May 2012 (27)
- April 2012 (30)
- March 2012 (29)
- February 2012 (32)
- January 2012 (25)
- December 2011 (38)
- November 2011 (28)
- October 2011 (46)
- September 2011 (63)
- August 2011 (35)
- July 2011 (24)
- June 2011 (24)
- May 2011 (24)
- April 2011 (29)
- March 2011 (50)
- February 2011 (48)
- January 2011 (18)
- December 2010 (5)
- November 2010 (18)
- October 2010 (22)
- September 2010 (29)
- August 2010 (24)
- July 2010 (27)
- June 2010 (29)
- May 2010 (25)
- April 2010 (23)
- March 2010 (10)
- February 2010 (6)
- January 2010 (16)
- December 2009 (12)
- November 2009 (3)
- October 2009 (11)
- September 2009 (21)
- August 2009 (11)
- July 2009 (11)
- June 2009 (5)
- May 2009 (12)
- April 2009 (20)
- November 22 (1)
Attila Kovacs on docs.embarcadero.com unreachab… |
David Blue on MacOS: converting a man page t… |
jpluimers on How do I pretty-print JSON in… |
jpluimers on Delphi 10.2 Tokyo Godzilla ISO… |
Ante on Delphi 10.2 Tokyo Godzilla ISO… |
Recent Posts
Blog Stats
Tag Cloud Title
Top Clicks
Top Posts
My badges
Twitter Updates
- RT @locuta: Apps als Tweetbot, Echofon en Twitterrific lijken niet per ongeluk, maar expres afgesloten (zonder enige communicatie uiteraard… 4 hours ago
- @KomtDatSchooot @boomerbrieven Woz waarde naar 95% leegwaarderatio is 950k met fictief rendement
58k belas… twitter.com/i/web/status/1…4 hours ago
My Flickr Stream
Pages
All categories
Email Subscription
zabbix on Windows: check the configuration before restarting the Zabbix Agent service
Posted by jpluimers on 2019/09/27
If the Zabbix configuration on Windows (especially mismatches in C:zabbixzabbix.agentd.conf.d ), then the Zabbix Agent will not start at all:
C:zabbixbinwin64>zabbix_agentd.exe —start
zabbix_agentd.exe [4711]: ERROR: cannot start service [Zabbix Agent]: [0x0000041D] The service did not respond to the start or control request in a timely fashion.
This is how to check it before starting the service:
C:zabbixbinwin64zabbix_agentd.exe —config C:zabbix_agentd.conf
zabbix_agentd.exe [43]: ERROR: cannot add user parameter «MyDuplicate[*],PowerShell.exe -File C:zabbixUniquePowerShellScript.ps1 «$1″»: key «MyDuplicate» already exists
The problem is that in the C:zabbixzabbix.agent.conf.d directory, two files had a similar config:
UserParameter=MyDuplicate[*],PowerShell.exe -File C:zabbixFirstPowerShellScript.ps1 «$1»
UserParameter=MyDuplicate[*],PowerShell.exe -File C:zabbixSecondPowerShellScript.ps1 «$1»
The problem is that the first part of UserParameter (before the [*] ) is a key which needs to be unique over all configuration files.
If everything is fine, you will see this:
C:zabbixbinwin64zabbix_agentd.exe —config C:zabbix_agentd.conf
zabbix_agentd.exe [1581]: use foreground option to run Zabbix agent as console application
If you need to manually start Zabbix as a service, then perform this (the first step is not needed if the service has already been stopped):
Источник
Учим zabbix-agent «есть» на ходу и не давиться пользовательскими параметрами (UserParameter)
Все те кто пользуются системой мониторинга Zabbix, с большой вероятностью, уже использовали UserParameter. Это, безусловно, очень полезный инструмент позволяющий значительно расширить базовые возможности Zabbix и поставить на мониторинг что-то такое эдакое. Но, к сожалению, у данного подхода есть свои минусы:
Необходимость распространение файлов конфигураций UserParameter
Необходимость перезапуска zabbix-agent после добавления UserParameter
Не нулевой шанс, что zabbix-agent не запустится после добавления некорректного файла конфигурации UserParameter
Проблему под пунктом 1 затрагивать не будем и перейдем к оставшимся двум, т.к. решив проблему 2 и 3 пунктов, та что под №1 станет чуть менее проблемной потому-что мы не будем бояться сломать запуск zabbix-agent при распространении файлов UserParameter.
Не так давно Zabbix в своем Release Notes for Zabbix 6.0.0 сообщил о том, что внедрил runtime команду для перечитки пользовательских параметров, без необходимости перезагрузки zabbix-agent. Но, по моему скромному мнению, что перезагрузка агента, что выполнение runtime команды (zabbix_agentd -R userparameter_reload) — являются дополнительным шагом при распространении UserParameter. А так как проблема с возможной поломкой запуска zabbix-agent не решена, то по прежнему распространение UserParameter остается не совсем безопасным этапом.
Запуск zabbix-agent достаточно просто сломать, не аккуратно работая с файлами пользовательских параметров. Добавьте агенту zabbix некорректный файл пользовательских параметров (дублирующие ключи, опечатки, лишние непечатаемые символы) и выполнив его перезагрузку, он пожалуется на конфиг и не запуститься. В случае если «плохой» UserParameter уже распространили на несколько тысяч или десятков тысяч серверов, то это очень неприятно исправлять. При большом парке серверов, большого разнообразия продуктов, нескольких десятков инженеров, разрабатывающих мониторинг, и нескольких сотен различных UserParameter, данная ситуация нет-нет, да и случится. Конечно же надо тестировать UserParameter перед распространением, но человеческий фактор никто не отменял.
Именно возможность сломать zabbix-agent, я считаю, основой опасностью UserParameter, и, поэтому, в первую очередь надо решать именно эту проблему.
Как же не стать параноиком и при этом не сломать zabbix-agent?
Не хочется мириться с потенциальным риском сломать zabbix-agent на большом количестве серверов практически одномоментно, но при этом хочется продолжать пользоваться пользовательскими параметрами, расширяя возможности мониторинга Zabbix.
Решение, которое можно предложить — это использовать один стандартный UserParameter (в связке со скриптом), который нам добавит возможность использования безопасно и динамически(как бонус) загружаемых пользовательских параметров.
Взаимодействие zabbix-agent с динамическими пользовательскими параметрами будет выглядеть следующим образом
Основные тезисы данного подхода:
Мы используем классические файлы UserParameter, т.е. переписывать ничего не придется.
Если UserParameter параметр не корректный, то сломается сбор данных только для данного UserParameter и только для ключа/ключей, где закралась ошибка
Если UserParameter попадает в директорию динамически загружаемых, то сбор метрик по нему начнется моментально.
Пример настройки на Linux
1. Создадим в /etc/zabbix/zabbix_agentd.d/ директорию dyn_up для динамических UserParameter:
2. Создадим в директории /etc/zabbix/zabbix_agentd.d/ скрипт dyn_up.sh со следующим содержимым:
3. Создадим в директории /etc/zabbix/zabbix_agentd.d/ наш единственный обычный UserParameter userparameter_dyn_up.conf со следующим содержимым:
UserParameter=dyn.up[*], ./dyn_up.sh «$1» «$2» «$3» «$4» «$5» «$6» «$7» «$8» «$9»
4. Запуск проверки будет выглядеть следующим образом:
P.S. Вашему вниманию представлен концепт, который опробован только на zabbix-агентах под Linux.
Скрипт для Windows может выглядеть следующим образом
Источник
Zabbix Agent User Parameters
Learn how to extend Zabbix agent functionality by adding your own checks that can be both – dynamic and static.
Contents
Introduction
The topic for today is user parameters in the Zabbix agent. Earlier we talked about how you can install the Zabbix server and Zabbix proxy. I have the same training virtual machine with CentOS 7, and SELinux and firewall are disabled because we are learning Zabbix.
So what is the user parameter and why should we use it in the context of the Zabbix agent?
Zabbix agent
You know that the Zabbix agent is a utility that is widely used to monitor local resources and applications in any Zabbix infrastructure. This is definitely the most popular monitoring tool simply because the Zabbix agent is a super lightweight software that consumes just a couple of MBs and does not burden the CPU.
We have RPM packages for the most popular Linux versions. It is also possible to easily install the Zabbix agent on any Windows machine.
What are the benefits of the Zabbix agent? The Zabbix agent has a lot of metrics that you can monitor from the box. This means that it is not required to invent something new. You don’t need to write custom scripts or figure out complex monitoring scenarios. All you need to do is spend two minutes of your time to install the Zabbix agent on the machine, then open the documentation.
In Configuration > Items > Item type > Zabbix agent, you will find all available monitoring items supported from the box that you can use without any additional configuration. Simply go to the front end, create a host for your Zabbix agent, create a new item, and make the one that you need with the help of documentation. You can monitor service state or free disk space, network interfaces, memory, and many other things from the box, or do some discovery.
User parameters
What is a user parameter? Sometimes you might need to monitor something on a Windows or Linux machine that is not very common, not the disk space or CPU load, but a specific application. And you know that you can get the desired metric easily with just a couple of commands in the CLI.
However, you cannot find the item in the documentation for that, and you need to somehow teach Zabbix to execute that small command or a bit more complex script and received value from the script or the command line as a value inside Zabbix.
Today we’ll actually talk about how to do that. We will also discuss the possible differences between what I would call a static user parameter and a dynamic user parameter.
In the CLI, we need to open the configuration file of the Zabbix agent that by default is stored here:
Search for UserParameter to create your own small or a larger item to collect some kind of specific data.
Creating user parameters
You can run a command in the CLI which returns information about the service, e.g. the copyright, revision, and also version — 4.0.5:
A similar script can be run for the agent:
Let’s try to create a user parameter to collect the major version of our binary, which is 4.0.5.
First, edit Zabbix agent configuration file:
Creating a new item
We can leave the default value as it is and write a new line. I’ll write ‘UserParameter=’ which is the key that you’ll have to use in the front end. It must be unique and must follow the key syntax that you can check in our official documentation. And you need to remember it.
When I create an item inside the front end with ‘Zabbix agent’ as Type and ‘static’ as Key, I will receive the same value as when executing this command.
Let’s make another user parameter. In the next line, I add ‘UserParameter’ with ‘dynamic’ as key, and then in the brackets, which we use in the front end to specify different parameters, we need to write *, then a comma and then the command that will be executed. The last part will depend on what we specify in the front end as item parameters. I will specify ‘$1’ which means the first parameter from my front end from the item configuration.
You can save the new parameters with ‘:wq’.
I’ll run the third parameter to show you that you need to be careful with user parameters:
So we have three user parameters. Remember that each time you make some changes to any Zabbix configuration file, Zabbix agent, a server or a proxy, etc., you always need to restart the process on the server itself, but only the process to which you’ve changed the configuration file. In our case, I use the following command:
Now we can actually go to the front end. In Configuration > Hosts I’ve added a new host which is called UserParameters with my localhost agent.
Adding new items
Let’s create new items in Configuration > Hosts > UserParameters > Items > Create Item.
We select ‘Agent version’ for Name, ‘Zabbix agent’ for Type, and ‘static’ for Key.
In the Type of information, you can specify ‘Numeric (float)’ because we will be extracting the actual 4.0 value from all that bunch of text. But since it is Zabbix 4.0, Zabbix will show it simply as ‘4’. Instead, we might be using ‘Text’. And I’ll set the Update interval of 5 seconds to make it work quicker.
Creating a new user parameter
As can be seen in the CLI, the command ‘zabbix_server −V’ displays a lot of information, while we need to extract only the information about the version. This means that we need to add a preprocessing step in Configuration > Hosts > UserParameters > Items > Preprocessing > Preprocessing steps.
In my case, I’ll select ‘Regular expression’ for Name. To select the Parameter value, let’s check what lines we have in the CLI. We have ‘zabbix_server (Zabbix) 4.0.5’.
So in the pattern, it will be ‘zabbix_.* ([0–9].[0–9])’, where * means there can be anything and [0–9] interval means a place for any number. And we want to display the first one as follows:
Click Add to add this new item. Now you can check the information about the version by clicking the Agent version in Configuration > Hosts > Items.
This is the static item, while we have also created a dynamic one. To check the user parameters, you can run:
So let us Clone the one that we’ve just created and change some values.
Here we will have ‘Server version’ for Name, the same ‘Zabbix agent’ for Type, but the Key is ‘dynamic’.
In the parameter, we specify the binary name that we want to use instead of ‘$1’:
As for the preprocessing, the Name and Parameter remain the same, as well as the first capturing rule.
Let’s add another item by clicking Clone. This one should have ‘Timeout example’ for Name and ‘Zabbix agent’ for Type. And we type ‘timeout’ for Key from our last user parameter:
Timeout user parameter
Preprocessing won’t actually matter here, so we won’t make any changes in the Preprocessing tab. I’ll just add this item with the same 5-second Update interval.
Then I’ll run the following command in the CLI simply to reload all the changes that we’ve just made in the front end and save us some time.
Note. If anything does not work properly, for example, an item is not supported because the regular expression does not match, you can run these commands to check for mistakes:
Make corrections in the vim file, then run ‘:wq’ to save changes, if any, and restart the agent:
Results
In Monitoring > Latest data, I can check the results by specifying the hostname, ticking off Show details and clicking Apply.
UserParameter latest data
We have three items. We have Agent version and Server version with the Last value of ‘4.0’. Remember that we are actually getting multiple lines of random text, but the preprocessing function helps us to filter for the version number.
The last item Timeout example is not supported. The error message reads “Timeout while executing a shell script”. Remember that in all the Zabbix processes there is a timeout parameter. It means that any custom user parameter that you create and that will be running for more than the timeout parameter will not be supported in the Zabbix front end.
So when you are creating your own custom checks, you need to make sure that those are running fast enough. If you have some custom scripts that are running for a longer period, you need to figure out another way to execute it and gather a metric as a value.
In the next videos we’ll definitely talk about it, and about other options to use UNIX scripts together with the Zabbix sender utility to monitor user-specific applications.
Conclusion
This was a quick insight into the Zabbix agent and Zabbix user parameters. If you have any additional questions about this topic or maybe some wishes for the next topics, you are welcome to comment and make suggestions.
Источник
Zabbix agent complains when trying to start:
Starting Zabbix agent: zabbix_agentd [...]: ERROR: cannot add user parameter
"mysql.status[*],echo "show global status where Variable_name='$1';" |
HOME=/var/lib/zabbix mysql -N | awk '{print $$2}'": key "mysql.status"
already exists
The file has been copied almost exactly from the existing userparameter_mysql.conf which has been renamed.
asked Jun 5, 2015 at 7:56
The reason was I had renamed the old one instead of removing it and zabbix agent picked up the renamed file in addition to the new one.
Moving the backup file away solved the problem.
Easy enough but I had already googled it and seen a couple of others struggle without getting an answer before I realized this so I figured I better post it.
answered Jun 5, 2015 at 7:59
Erik IErik I
4833 gold badges7 silver badges18 bronze badges
Another reason you might see this is that your editor software has created a backup userparameter file in the same directory that may be hidden. If you do a
grep -r "<your duplicate key name here>" *
from within the
/etc/zabbix/
folder you may find where else its defined. In my case it was nano that created it when my ssh session timed out before I exited the editor.
answered Dec 12, 2016 at 11:53
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
Comments
I got the error below after I copied userparameter_pgsql.conf in pg_monz ver 2.0.1 to ../zabbix_agentd.d and restart the zabbix agent. I have to remark all the userparameter or move the userparameter_pgsql.conf file to other location only I am able to start my zabbix agent. Anyone has idea what is going on? Thanks alot.
Starting Zabbix agent: zabbix_agentd [77914]: ERROR: cannot add user parameter «db.list.discovery[*],»$1″/find_dbname.sh «$2″»: key «db.list.discovery» already exists
Sorry for the late reply.
The reason of the error is probably because that the key
«db.list.discovery» has already been configured in zabbix_agentd.conf or in one of the config files under zabbix_agentd.d directory.
So please delete the existing setting of key db.list.discovery, copy userparameter_pgsql.conf to zabbix_agentd.d directory and restart zabbix agent again.
I spent two days looking for the cause of the problem, I finally found in zabbix_agentd. Conf «include» multiple configuration.
change:
Include=/usr/local/etc/zabbix_agentd.conf.d/
Include=/usr/local/etc/zabbix_agentd.conf.d/.conf
to:
Include=/usr/local/etc/zabbix_agentd.conf.d/.conf
then it goes well.
Posted by jpluimers on 2019/09/27
If the Zabbix configuration on Windows (especially mismatches in C:zabbixzabbix.agentd.conf.d
), then the Zabbix Agent will not start at all:
C:zabbixbinwin64>zabbix_agentd.exe --start
zabbix_agentd.exe [4711]: ERROR: cannot start service [Zabbix Agent]: [0x0000041D] The service did not respond to the start or control request in a timely fashion.
This is how to check it before starting the service:
C:zabbixbinwin64zabbix_agentd.exe --config C:zabbix_agentd.conf
zabbix_agentd.exe [43]: ERROR: cannot add user parameter "MyDuplicate[*],PowerShell.exe -File C:zabbixUniquePowerShellScript.ps1 "$1"": key "MyDuplicate" already exists
The problem is that in the C:zabbixzabbix.agent.conf.d
directory, two files had a similar config:
UserParameter=MyDuplicate[*],PowerShell.exe -File C:zabbixFirstPowerShellScript.ps1 "$1"
UserParameter=MyDuplicate[*],PowerShell.exe -File C:zabbixSecondPowerShellScript.ps1 "$1"
The problem is that the first part of UserParameter
(before the [*]
) is a key which needs to be unique over all configuration files.
If everything is fine, you will see this:
C:zabbixbinwin64zabbix_agentd.exe --config C:zabbix_agentd.conf
zabbix_agentd.exe [1581]: use foreground option to run Zabbix agent as console application
If you need to manually start Zabbix as a service, then perform this (the first step is not needed if the service has already been stopped):
C:zabbixbinwin64>zabbix_agentd.exe --stop
zabbix_agentd.exe [1642]: service [Zabbix Agent] stopped successfully
C:zabbixbinwin64>zabbix_agentd.exe --start
zabbix_agentd.exe [1642]: service [Zabbix Agent] started successfully
–jeroen
This entry was posted on 2019/09/27 at 06:00 and is filed under *nix, Linux, Monitoring, Power User, Windows, Zabbix.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Агент Zabbix жалуется при попытке запуска:
Starting Zabbix agent: zabbix_agentd [...]: ERROR: cannot add user parameter
"mysql.status[*],echo "show global status where Variable_name='$1';" |
HOME=/var/lib/zabbix mysql -N | awk '{print $$2}'": key "mysql.status"
already exists
Файл был почти полностью скопирован из существующего userparameter_mysql.conf, который был переименован.
2015-06-05 07:56
2
ответа
Решение
Причина была в том, что я переименовал старый вместо того, чтобы удалить его, и агент zabbix взял переименованный файл в дополнение к новому.
Удаление файла резервной копии решило проблему.
Достаточно легко, но я уже гуглил это и видел, как несколько других боролись, не получив ответа, прежде чем я понял это, поэтому я решил, что лучше опубликовать это.
Erik I
05 июн ’15 в 07:59
2015-06-05 07:59
2015-06-05 07:59
Другая причина, по которой вы можете увидеть это, заключается в том, что ваше программное обеспечение редактора создало резервный файл параметров пользователя в том же каталоге, который может быть скрыт. Если вы делаете
grep -r "<your duplicate key name here>" *
изнутри
/etc/zabbix/
папку, которую вы можете найти, где еще она определена. В моем случае это был nano, который создал его, когда истек срок моей сессии ssh, прежде чем я вышел из редактора.
ChrisJ
12 дек ’16 в 11:53
2016-12-12 11:53
2016-12-12 11:53
My Flickr Stream
Pages
All categories
Email Subscription
zabbix on Windows: check the configuration before restarting the Zabbix Agent service
Posted by jpluimers on 2019/09/27
If the Zabbix configuration on Windows (especially mismatches in C:zabbixzabbix.agentd.conf.d ), then the Zabbix Agent will not start at all:
C:zabbixbinwin64>zabbix_agentd.exe —start
zabbix_agentd.exe [4711]: ERROR: cannot start service [Zabbix Agent]: [0x0000041D] The service did not respond to the start or control request in a timely fashion.
This is how to check it before starting the service:
C:zabbixbinwin64zabbix_agentd.exe —config C:zabbix_agentd.conf
zabbix_agentd.exe [43]: ERROR: cannot add user parameter «MyDuplicate[*],PowerShell.exe -File C:zabbixUniquePowerShellScript.ps1 «$1″»: key «MyDuplicate» already exists
The problem is that in the C:zabbixzabbix.agent.conf.d directory, two files had a similar config:
UserParameter=MyDuplicate[*],PowerShell.exe -File C:zabbixFirstPowerShellScript.ps1 «$1»
UserParameter=MyDuplicate[*],PowerShell.exe -File C:zabbixSecondPowerShellScript.ps1 «$1»
The problem is that the first part of UserParameter (before the [*] ) is a key which needs to be unique over all configuration files.
If everything is fine, you will see this:
C:zabbixbinwin64zabbix_agentd.exe —config C:zabbix_agentd.conf
zabbix_agentd.exe [1581]: use foreground option to run Zabbix agent as console application
If you need to manually start Zabbix as a service, then perform this (the first step is not needed if the service has already been stopped):
Источник
Error cannot create service zabbix agent 0x00000430
После установки Zabbix сервера , произведем установку, настройку zabbix клиента на операционной системе Windows. Zabbix клиент обеспечит передачу и обработку данных на сервере.
Установка, настройка и удаление zabbix агента
1. Скачиваем с сайта zabbix дистрибутив zabbix агента для операционной системы Windows.
2. Разархивируем архив и переименовываем папку, например Zabbix_agent.
3. Перемещаем папку в нужную директорию, например С:Program Files.
.
Конфигурация zabbix агента
4. Следующим шагом необходимо сконфигурировать zabbix агент, чтобы была возможность работы связки клиент-сервер. Для этого открываем конфигурационный файл zabbix_agentd.win.conf.
5. Меняем путь до лог файла, например LogFile=C:Program FilesZabbix_agentzabbix_agentd.log.
6. Для того, чтобы определить ip адрес сервера, открываем терминал на сервере и набираем команду ip addr.
7. В конфигурационном файле zabbix агента в секции «Option Server» указываем ip адрес сервера:
Server=192.168.20.158
8. В секции «Option: ServerActive» также указываем ip адрес сервера zabbix:
Server=192.168.20.158
В секции «Option: Hostname» указываем имя компьютера, например Hostname=Int.
Установка и запуск службы zabbix
9. После того, как сохранили конфигурационный файл, открываем командную строку с административными правами. Для установки и запуска службы Zabbix agent в командной строке набираем:
«C:Program FilesZabbix_agentbinzabbix_agentd.exe» — config «C:Program FilesZabbix_agentconfzabbix_agentd.win.conf» — install
C:Program FilesZabbix_agentbinzabbix_agentd.exe — путь до программы;
C:Program FilesZabbix_agentconfzabbix_agentd.win.conf — путь до конфигурационного файла.
После успешного применения команды появится вывод:
zabbix_agent.exe [18168]: service [Zabbix Agent] installed successfully
zabbix_agent.exe [18168]: event source [Zabbix Agent] installed successfully
Если командную строку запустить не с правами администратора, то получим ошибку:
zabbix_agentd.exe [20260]: ERROR: cannot connect to Service Manager: .
Для запуска службы «Zabbix Agent» выполняем следующую команду:
net start «Zabbix agent»
После успешного выполнения команды в командной строке появится:
Служба «Zabbix Agent» успешно запущена.
Прописываем правила соединения в брандмауэре Защитника Windows
10. Для того, чтобы обеспечить передачу данных с клиента на сервер, необходимо разрешить zabbix агенту связываться с сервером. Пропишем необходимые правила для сетевого соединения в брандмауэре Windows. Открываем «Панель управления» далее «Брандмауэр Защитника Windows«.
11. Далее выбираем «Дополнительные параметры«.
12. В следующем окне выбираем «Правила для входящих подключений» — «Создать правило«.
13. В открывшемся окне делаем выбор «Для программы«, нажимаем «Далее«.
14. Указываем с помощью кнопки «Обзор. » путь до программы, например %ProgramFiles%Zabbix_agentbinzabbix_agentd.exe, нажимаем «Далее«.
15. Выбираем «Разрешить подключение» — «Далее«.
16. В новом окне задаем «Имя«, например: «Zabbix_agent_in» — «Готово«.
17. Затем открываем вновь созданное соединение Zabbix_agent_in, затем выбираем вкладку «Протоколы и порты«
Тип протокола: TCP
Специальные порты:
10050
Затем нажимаем «ОК«.
Добавление узла сети на сервере Zabbix
18. Для добавления узла сети на сервере Zabbix заходим в веб-панель сервера с помощью логина и пароля, далее выбираем: «Настройка» — «Узлы сети» — «Создать узел сети«.
19. В новом окне указываем:
Имя узла сети: например, Int
Группы: выбираем из списка с помощью кнопки «Выбрать» или пишем новое имя группы
Интерфейсы агента: задаем IP адреса клиента (в командной строке клиента надо набрать ipconfig /all)
20. Переходим на вкладку «Шаблоны«, нажимаем «Выбрать» и из списка шаблонов, выбираем нужный, в данном случае «Template OS Windows«, нажимаем «Выбрать«.
21. Далее выбираем » Добавить » для присоединения выбранного шаблона, затем ниже нажимаем «Добавить» для добавления нового узла сети.
22. В списке появится новый узел сети, и через некоторое время узел сети станет зеленым. Это значит, что все настроено правильно и связь с клиентом установлена.
23. Если узел сети остается красным, то необходимо разбираться, в чем дело. Для этого наводим на значок в графе «Доступность» и читаем диагностическое объявление.
24. Далее переходим к клиенту и открываем лог файл zabbix агента (C:Program FilesZabbix_agentconfzabbix_agentd.win.conf).
Смотрим проблему, в данном случае:
failed to accept an incoming connection: connection from «192.168.11.49» rejected, allowed hosts: «192.168.20.158»
25. Для решения проблемы прописываем IP адрес клиента в конфигурационный файл zabbix агента:
Option: Server
Server=192.168.11.69, 192.168.20.158
26. Для применения измененных настроек перезапускаем службу Zabbix agent:
net stop «Zabbix agent»
net start «Zabbix agent»
27. Проверяем лог файл.
28. Если нет проблем, на сервере появится зеленый значок клиента.
Удаление zabbix агента
29. Для удаления zabbix агента, удаляем узел сети на сервере.
30. Останавливаем службу «Zabbix agent» на клиенте.
net stop «Zabbix Agent»
31. Удаляем папку с компонентами zabbix агента.
32. Удаляем правило для входящих подключений для zabbix агента.
Посмотреть видео как произвести установку, настройку и удаление zabbix агента можно здесь:
Источник
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
My Flickr Stream
Pages
All categories
Email Subscription
zabbix on Windows: check the configuration before restarting the Zabbix Agent service
Posted by jpluimers on 2019/09/27
If the Zabbix configuration on Windows (especially mismatches in C:zabbixzabbix.agentd.conf.d ), then the Zabbix Agent will not start at all:
C:zabbixbinwin64>zabbix_agentd.exe —start
zabbix_agentd.exe [4711]: ERROR: cannot start service [Zabbix Agent]: [0x0000041D] The service did not respond to the start or control request in a timely fashion.
This is how to check it before starting the service:
C:zabbixbinwin64zabbix_agentd.exe —config C:zabbix_agentd.conf
zabbix_agentd.exe [43]: ERROR: cannot add user parameter «MyDuplicate[*],PowerShell.exe -File C:zabbixUniquePowerShellScript.ps1 «$1″»: key «MyDuplicate» already exists
The problem is that in the C:zabbixzabbix.agent.conf.d directory, two files had a similar config:
UserParameter=MyDuplicate[*],PowerShell.exe -File C:zabbixFirstPowerShellScript.ps1 «$1»
UserParameter=MyDuplicate[*],PowerShell.exe -File C:zabbixSecondPowerShellScript.ps1 «$1»
The problem is that the first part of UserParameter (before the [*] ) is a key which needs to be unique over all configuration files.
If everything is fine, you will see this:
C:zabbixbinwin64zabbix_agentd.exe —config C:zabbix_agentd.conf
zabbix_agentd.exe [1581]: use foreground option to run Zabbix agent as console application
If you need to manually start Zabbix as a service, then perform this (the first step is not needed if the service has already been stopped):
Источник
Zabbix agent on Windows — Service could not start
I had already configured Zabbix Server on Centos. I would like monitor one of our windows (2012 r2 and windows 7) servers for testing purpose. I am doing this as following method:
1. Downloaded zabbix agent from official site. Extracted to Windows >Program Files > Zabbix (created) folder.
2. Then run as Administrator cmd > «C:Program FilesZabbixbinwin64zabbix_agentd.exe» —c «C:/Program Files/Zabbix/conf/zabbix_agentd.win.conf» -i
It is installed successfully. I am already show zabbix agent at services.msc.
3. Then I would like to start this services. It couldn’t start.
My zabbix_agentd.win.conf file :
Ransomware 3.0: Prep for A New Malicious Threat Level
Contact Zabbix support:
3 Replies
Anything in that log file you mention? also, any events in the windows event logs?
Log file is empty. Log At Event Viewer same as my screenshot.
Contact Zabbix support:
This topic has been locked by an administrator and is no longer open for commenting.
To continue this discussion, please ask a new question.
Read these next.
User Account Getting Locked Out
We have a user that continually has their account locked out. There are times where she gets up from her computer and locks it, only to come back a short while later to login and she’ll be locked out. I’ve looked in the event viewer on the DC but it doesn.
IT Manager struggling for help!
Hello Spiceheads,I am having a hard time trying to get the CEO/ sole Owner of my company to understand that I need help to be able to get my job done more effciently or to actually get my job done.My job responsabilities/Priorities1. Cybersecurity.2. Ba.
Snap! — AI Counseling, Twin Black Holes, Digital Plates Hacked, Smart T-Rex
Your daily dose of tech news, in brief. Welcome to the Snap! Flashback: Back on January 11, 1960: Committee Convenes to Develop Algol (Read more HERE.) Bonus Flashback: Back on January 11, 1997: Telstar 401 Satellite Mysteriously Fails (R.
Firewall for multisite medical center
Hey everyone. I am working with a client who needs a firewall solution that will offer alert monitoring (zero day. etc) / SD WAN for multi-site setup. Can be cloud or on prem hardware. I imagine that I should layer with a security monitoring software .
Laptop deployments
Hi all,I am looking for suggestions for laptop deployment software please. We usually build maybe one or two laptops a month, but we have a mass laptop roll out coming up to replace aging hardware so rather than spend time configuring each laptop, I’d li.
Источник
Centos Agent won’t Start
Details
Description
Agent will not start. I am logged in as root. Thoughts?
Zabbix_agentd.log.
9664:20161118:182818.165 Starting Zabbix Agent [Performance Monitor]. Zabbix 3.0.5 (revision 62889).
9664:20161118:182818.170 **** Enabled features ****
9664:20161118:182818.177 IPv6 support: YES
9664:20161118:182818.184 TLS support: YES
9664:20161118:182818.190 **************************
9664:20161118:182818.195 using configuration file: /etc/zabbix/zabbix_agentd.conf
9664:20161118:182818.201 cannot set resource limit: [13] Permission denied
9664:20161118:182818.206 cannot disable core dump, exiting.
Audit log.
type=AVC msg=audit(1479493372.945:331696): avc: denied < setrlimit >for pid=9205 comm=»zabbix_agentd» scontext=unconfined_u:system_r:zabbix_agent_t:s0 tcontext=unconfined_u:system_r:zabbix_agent_t:s0 tclass=process
type=SYSCALL msg=audit(1479493372.945:331696): arch=c000003e syscall=160 success=no exit=-13 a0=4 a1=7ffffc44c790 a2=0 a3=7ffffc44c510 items=0 ppid=1 pid=9205 auid=511 uid=497 gid=498 euid=497 suid=497 fsuid=497 egid=498 sgid=498 fsgid=498 tty=(none) ses=10374 comm=»zabbix_agentd» exe=»/usr/sbin/zabbix_agentd» subj=unconfined_u:system_r:zabbix_agent_t:s0 key=(null)
Attachments
Issue Links
ZBX-10542 zabbix-server can not start on rhel 7.1
- Closed
The issue is considered finished, the resolution is correct. Issues which are closed can be reopened. «>Closed
Activity
People
Dates
Powered by a free Atlassian Jira open source license for ZABBIX SIA. Try Jira — bug tracking software for your team.
Источник