Skip to content

Instantly share code, notes, and snippets.

@ioxorg
Created May 7, 2023 11:19
Show Gist options
  • Save ioxorg/36ffd421ad3099e138af1e75853f5418 to your computer and use it in GitHub Desktop.
Save ioxorg/36ffd421ad3099e138af1e75853f5418 to your computer and use it in GitHub Desktop.
ugly CLocalApiCLient.php patch
--- /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php.orig 2023-03-08 16:23:26.555055621 +0100
+++ /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php 2023-03-08 16:22:46.378217849 +0100
@@ -128,6 +128,13 @@
$newTransaction = true;
}
+ // UGLY GRAFANA DATASOURCE HACK
+ // rename "user" param to "username" when present
+ if ($params['user'] ?? null) {
+ $params['username'] = $params['user'];
+ unset($params['user']);
+ }
+
$result = call_user_func_array([$this->serviceFactory->getObject($api), $method], [$params]);
// if the method was called successfully - commit the transaction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment