Closed exa-mk closed 3 years ago
I was unable to reproduce this issue. I tried PUSH and PULL mode. Both worked as expected. Please do not add any escaping manually, it is not required! I would recommend to delete the service and recreate it again through the wizard.
My customchecks.ini:
[nfs_io__/nfs/home]
command = /usr/bin/echo "This is the command nfs_io__/nfs/home"
interval = 10
timeout = 5
enabled = True
Create Service:
Monitoring results:
My Service defenition:
It is worth mentioning that the escaping is done by the JSON library and should be transparent to the end user
root@1fa7afc81cda:/# php -v
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
root@1fa7afc81cda:/# php -a
Interactive mode enabled
php > $test = ['nfs_io__/nfs/home' => 'data'];
php > $json = json_encode($test);
php > print_r($json);
{"nfs_io__\/nfs\/home":"data"} // Has escaping in json
php > print_r(json_decode($json, true));
Array
(
[nfs_io__/nfs/home] => data // Escaping is gone as soon as JSON string got processed by PHP
)
php >
Re-creating the check seems to work. It's a bit stange a the checks don't look differently from before where they refused to work. That's why I tried to escape the path in the first time.
Perfect, I'll close the issue. Feel free to reopen if you have any further issues.
Agent Mode:
Versions
Operating system Server: Ubuntu 20.04 Agent: CentOS, Fedora
Describe the bug I have some agent custom checks that include path names in the check identifier. After the upgrade from agent 1.x to 3.x I recognized these are now escaped by a \ before each path seperator /. I fixed the check names within the server but they still don't seem to be recognized:
Check output:
Agent push data:
Agent customcheck config:
To Reproduce Include above customcheck config in agent and add service to monitoring.
Expected behavior Service check result data is recognized properly. In best case I don't need to escape the customcheck name in the server at all.
Screenshots see above