The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,847 other followers

Archive for September, 2019

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:\zabbix\zabbix.agentd.conf.d), then the Zabbix Agent will not start at all:

C:\zabbix\bin\win64>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:\zabbix\bin\win64\zabbix_agentd.exe --config C:\zabbix_agentd.conf
zabbix_agentd.exe [43]: ERROR: cannot add user parameter "MyDuplicate[*],PowerShell.exe -File C:\zabbix\UniquePowerShellScript.ps1 "$1"": key "MyDuplicate" already exists

The problem is that in the C:\zabbix\zabbix.agent.conf.d directory, two files had a similar config:

UserParameter=MyDuplicate[*],PowerShell.exe -File C:\zabbix\FirstPowerShellScript.ps1 "$1"
UserParameter=MyDuplicate[*],PowerShell.exe -File C:\zabbix\SecondPowerShellScript.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:\zabbix\bin\win64\zabbix_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:\zabbix\bin\win64>zabbix_agentd.exe --stop
zabbix_agentd.exe [1642]: service [Zabbix Agent] stopped successfully

C:\zabbix\bin\win64>zabbix_agentd.exe --start
zabbix_agentd.exe [1642]: service [Zabbix Agent] started successfully

–jeroen

Posted in *nix, Linux, Monitoring, Power User, Windows, Zabbix | Leave a Comment »

Soap Delphi Client end with a timeout for a 1MB call – Stack Overflow

Posted by jpluimers on 2019/09/26

This was a change between IE6 and IE7 on the default time-out decreasing from 3600 seconds to 30 seconds: [WayBack] Soap Delphi Client end with a timeout for a 1MB call – Stack Overflow.

If you want to increase the timeout, then use InternetSetOption. You can get the current value using InternetQueryOption.

In Delphi, THTTPReqResp.Send supports this by setting the various time out options right after creating the request:

    Request := HttpOpenRequest(FInetConnect, 'POST', PChar(FURLSite), nil,
                               nil, nil, Flags, 0{Integer(Self)});
    Check(not Assigned(Request));

    { Timeouts }
    if FConnectTimeout > 0 then
      Check(not InternetSetOption(Request, INTERNET_OPTION_CONNECT_TIMEOUT, Pointer(@FConnectTimeout), SizeOf(FConnectTimeout)));
    if FSendTimeout > 0 then
      Check(not InternetSetOption(Request, INTERNET_OPTION_SEND_TIMEOUT, Pointer(@FSendTimeout), SizeOf(FSendTimeout)));
    if FReceiveTimeout > 0 then
      Check(not InternetSetOption(Request, INTERNET_OPTION_RECEIVE_TIMEOUT, Pointer(@FReceiveTimeout), SizeOf(FReceiveTimeout)));

Related:

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, SOAP/WebServices, Software Development | Leave a Comment »

does anyone know of any Spring.Container examples (preferably non trivial) th…

Posted by jpluimers on 2019/09/26

Via [WayBack] does anyone know of any Spring.Container examples (preferably non trivial) that show how to build an app with a container just referenced from the Compo… – Russell Weetch – Google+:

Stefan Glienke:

The principle of having a composition root has nothing to do with a particular DI container. Its what you eventually get when following the principle if DI: ask for dependencies – don’t create or look for them yourself (aka service locator).

You did not mention it but I guess you mean a VCL application – now the design of the VCL is not particularly built with DI in mind and thus it can be a bit tricky to hook up the application MainForm to the container to get it injected everything. However there are several examples how to achieve that (mainly by using DelegateTo and doing the Application.CreateForm there).

An example explaining this is for instance in [WayBack] How to initialize main application form in Spring4D GlobalContainer?

Many more can be found through Spring4d DelegateTo and Spring4d DelegateTo CreateForm and

–jeroen

Posted in Delphi, Development, Software Development, Spring4D | Leave a Comment »

Boolean Values and Operators

Posted by jpluimers on 2019/09/26

TL;DR from [WayBackAutomating the world one-liner at a time… Boolean Values and Operators:

In PowerShell use the built-in constants $false and $true, as strings will be converted to booleans with results you don’t like

–jeroen

Posted in CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »

How to expose a Delphi set type via Soap – Stack Overflow

Posted by jpluimers on 2019/09/25

Marjan Venema had a great answer at [WayBack] How to expose a Delphi set type via Soap – Stack Overflow.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, SOAP/WebServices, Software Development | Leave a Comment »

 
%d bloggers like this: