Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - vardenx

#1
German - Deutsch / Re: CheckMK Agent Standalone
July 12, 2023, 11:28:52 AM
Hi,
ich habe den Check gerade ausprobiert und er funktioniert bis auf eine Sache einwandfrei:

Der DHCP-Pool-Check zeigt ein UNKN an und CMK meint er wäre gecrashed.
Die Ausgabe des Agents sieht so aus:

<<<isc_dhcpd>>>
[general]
PID: 29313
[pools]
10.10.16.160 10.10.16.180
[leases]


Da es keine Leases gibt ist das auch absolut korrekt. Ich versteh nur nicht, wieso CMK glaubt, dass der Check fehlgeschlagen oder abgestürzt ist.
Ich verwende CMK 2.2.0p5 (die Managed Service Edition) und das Agent Skript 1.0.6

Und übrigens danke für die tolle Arbeit!
Mir gefällt vor allem die einfache Installation. Den DHCP-Check brauch ich eigentlich auch nicht, aber irgendwie interessiert mich jetzt trotzdem was da schief geht. :-)

LG,
Roland.


EDIT:
Ich habe eine Config-Datei erstellt (/usr/local/etc/checkmk.conf) und das reingeschrieben:
skipcheck: dhcp
Das hat die Sache für mich gelöst.
#2
Hi,
another question about restarting the nginx service afterwards:

I thought it would be as easy as this:

curl -k -u 'bWF...':'NQV+...' https://10.10.13.1:8443/api/nginx/service/restart


I get this response:

{"response":[]}

and the service did not restart. At least it has the same PID as before, which should not be the case I guess.

Thanks in advance,
Roland.
#3
That worked.
"no_use":"down" sets it to permanently unreachable and
"no_use":"backup" sets it to backup server.

Thanks a lot!
#4
Hi,
I would like to change the upstream server for Nginx via the API.
I'm able to change several attributes with the API, but the one thing I'd like to do doesn't work.

This (for example) works:
curl --location --request POST 'https://10.10.13.1:8443/api/nginx/settings/setupstreamserver/99bfa024-506b-4b1a-8481-bebe2d02fa41'; \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YldGRXdrV3VxYXRoOVIwWmpFcWkwdng ... ZSXRXTTI=' \
--data-raw '{"upstream_server":{"description":"missrv2"}}'


This doesn't:
curl --location --request POST 'https://10.10.13.1:8443/api/nginx/settings/setupstreamserver/99bfa024-506b-4b1a-8481-bebe2d02fa41'; \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YldGRXdrV3VxYXRoOVIwWmpFcWkwdng ... ZSXRXTTI=' \
--data-raw '{"upstream_server":{"no_use":{"down":{"selected":1}}}}


The error message is:
{
    "errorMessage": "/usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php:159: Error at /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php:337 - Array to string conversion (errno=8)",
    "errorTrace": "#0 /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php(337): OPNsense\\Base\\ApiControllerBase->APIErrorHandler(8, 'Array to string...', '/usr/local/opns...', 337, Array)\n#1 /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php(446): OPNsense\\Base\\FieldTypes\\BaseField->__toString()\n#2 /usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableModelControllerBase.php(218): OPNsense\\Base\\BaseModel->performValidation()\n#3 /usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableModelControllerBase.php(454): OPNsense\\Base\\ApiMutableModelControllerBase->validate(Object(OPNsense\\Base\\FieldTypes\\ContainerField), 'upstream_server')\n#4 /usr/local/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php(155): OPNsense\\Base\\ApiMutableModelControllerBase->setBase('upstream_server', 'upstream_server', '99bfa024-506b-4...')\n#5 [internal function]: OPNsense\\Nginx\\Api\\SettingsController->setupstreamserverAction('99bfa024-506b-4...')\n#6 [internal function]: Phalcon\\Dispatcher\\AbstractDispatcher->callActionMethod(Object(OPNsense\\Nginx\\Api\\SettingsController), 'setupstreamserv...', Array)\n#7 [internal function]: Phalcon\\Dispatcher\\AbstractDispatcher->dispatch()\n#8 /usr/local/opnsense/www/api.php(26): Phalcon\\Mvc\\Application->handle('/api/nginx/sett...')\n#9 {main}",
    "errorTitle": "An API exception occured"
}


I thought maybe I need to deselect the active one first or do the deactivation of the old and the activation of the new one in one step, but these two other solution approaches didn't work either.
I guess it's more of a syntax problem, but I can't see what that could be.

Can someone give me a hint?

LG,
Roland.