Comments (7)
It appears putting the query into a macro variable works, but it's not an ideal solution. Some of the queries at the app level are going to be around 400 characters. I don't want to create a bunch of macro variables for those.
Any suggestions?
Thanks,
Rob
from libzbxpgsql.
Hmmm... really good challenge. We could push for the character limit to be increased but I'm not convinced that is a smart way forward.
How helpful would it be if I documented up a template for writing and compiling your own keys in the module? Just copy and paste in your own queries and make
.
from libzbxpgsql.
I'd prefer a method that wouldn't require recompiling every time we change something. Would it be possible to read the sql by key from a config file in "/etc/zabbix" or "/etc/zabbix/zabbix_agentd.d" ?
from libzbxpgsql.
Would you prefer to define all of your queries in an INI style file or as individual query files?
I think individual files would be better in that there is no character escaping required. The query could then be referenced in the Zabbix agent key by file name. E.g. pg.query.interger[,,query_file]
. These could maybe be stored in /etc/zabbix/libzbxpgsql.d/*.sql
or a path configured via environment variable. This is also fairly simple to implement in code.
A single config file could get a little unwieldy with lots of multi-line queries and character escaping, but it would more intuitive for defining other things like a pre-allocated agent key, data type, etc.
from libzbxpgsql.
If I had to choose between them I'd go with a single file, but if you feel strongly about multiple files I could live with that. IMHO a single file is easier to maintain. Plus if you have need to define other parameters (like maybe session options such as statement_timeout... hint hint) they could live there as well.
Escaping things isn't a big deal to me... I live for dollar quotes and backslashes... lol!
Simple variable assignment or INI or YAML or whatever standard you want to use would be fine, I can adapt. Even XML would work (sigh), though I hate XML.
BTW - Thanks for all your hard work on this, I think this plugin will rapidly become very popular!
from libzbxpgsql.
I've pushed some fairly major refactoring in 4663596. I apologise as it has removed your contributions from blame view, but your implementation and commit history are still in tact.
These are few changes that are hopefully of value:
- there's a single config file now, that can be used to import additional config files, instead of using file globbing
- configuration files can be used for other future things - for now it only supports
queries = {}
- config/named-query logic is in a discrete code file
src/pg_config.c
- theres a lot less log noise now
from libzbxpgsql.
Added in release v1.1.0
from libzbxpgsql.
Related Issues (20)
- rpm spec file in sources HOT 2
- Database capacity on some DBs HOT 3
- Redirect or disable log HOT 29
- Connections are not closed properly, creates a lot of TCP reset (RST) HOT 1
- D-Bus connection problem HOT 2
- pg.table.discovery in state "not supported" if some database not finded
- temp utilization monitoring
- pg.table.size exclude TOAST, but pg.table.discovery exclude TOAST too
- n_live_tup and n_dead_tup are always 0 for "PostgreSQL Database estimates live/dead rows|"
- libzbxpgsql.so: undefined symbol: __zbx_zbx_snprintf HOT 3
- Failing with Error when i try to start zabbix agent : undefined symbol: __zbx_zbx_snprintf HOT 2
- Filter partitioned tables from LLD Rule `Discover PostgreSQL Databases`
- Incorrect example in documentation
- Is this an error in the template or did I miss something?
- Zabbix agent crashes trying to load module libzbxpgsql.so on AIX HOT 7
- Graph for connection count grouped by database on database server? Possible? HOT 1
- fe_sendauth: no password supplied
- cannot load modules "zabbix_module_docker.so": usr/local/zabbix/lib/modules/zabbix_module_docker.so : undefined symbol : zbx_log_level HOT 2
- Support logging from zabbix 6.4 HOT 6
- Setup CI for migrated repo HOT 6
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.
from libzbxpgsql.