-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] pgsql schema not working #147
Comments
zabbix-formula/zabbix/pgsql/schema.sls Line 54 in 2c67b11
| head -5 - will limit output form psql , without it there will be a lot of output here.
Missed |
|
can somehow zabbix-server, zabbix-frontend, zabbix-psql be set at once? i've just found out i've missed the zabbix-pgsql part :) i don;t see a point in setting those things 3 times as they will always be the same in the same setup. i had to comment out the dependency on upload_sql_file ( i have it overriden for suse path), to even try, otverwise it would fail there (what is the point of copying exiating file anyway?) with "Specified file upload_sql_dump is not an absolute path" even though it is and exists also had to comment out the check_db_pgsql (i assume because it tries to check on local db that doesn't exist) to try import. and after all this, i still get only 3 tables imported (+2 indexes). if i remove the head -5, then it imports all of them.
|
regarding the head, it definitely ends the import prematurely. if we don;t care about which part of the output is shown, it can be done with tail, bit this is definitely wrong. i'm experimenting with the checks, but doing it with remote DB and not having superuser access seems not an easy part, i'll likely have to do some overrides or edit the checks to be able to check "itself" (the user and db) with nonsuperuser user |
i finally made it work, see the pullrequest. I'll need to do something about the long line though to pass pipeline :) another thing that i'd like to change (likely as separate PR though), is to split zabbix.pgsql.conf into two -> oner to install packages, one to create user and db. so it doesn't fail, if you run it against remote DB that someone else created for you and you don't have superuser (the schema import works now, but the user and db steps fail) would it be better accepted as nonbreaking change, i.e. create something like zabbix.pgsql.packages and include it from zabbix.pgsql.conf, or keep the name zabbix.pgsql.conf fot the base things like packages and create new state zabbix.pgsql.xxxx (i can't figure good name now, something like dbanduser) that would create db and the user? it would require ppl who want the db created to add that sls into their roles or wherever they use it. |
I'm now investigating the pgsql schema import and i don;t understand this line in
zabbix/pgsql/schema.sls:
- name: zcat {{ sql_file }} | psql | head -5
it sounds to me like someone was just testing it with the -5 and didn't finish at all. or am i missing something deeper?
also the zcat may not be installed by default, so it should be installed first if wants to be used.
if you're wanting to reuse existing (remote) DB (don't have the permission to create one), postgresql client will be missing too, as it's installed by conf.
i'll test it now more, because i'm not sure it would work with remote DB (it has the variables there, but the errors i was getting looked like they didn't use)
The text was updated successfully, but these errors were encountered: