Skip to content
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

Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "-db01.archive_command.status". #1

Open
mbuyukkarakas opened this issue Mar 1, 2021 · 8 comments

Comments

@mbuyukkarakas
Copy link

Zabbix agent is collecting the JSON data and sending to Zabbix server without problem.

{"db01": {"archive_command": {"hint": "", "status": "OK"}, "archive_mode": {"hint": "", "status": "OK"}, "archiver_errors": {"hint": "", "status": "OK"}, "backup_maximum_age": {"hint": "interval provided: 10 days, latest backup age: 19 hours, 33 minutes, 57 seconds", "status": "OK"}, "compression_settings": {"hint": "", "status": "OK"}, "continuous_archiving": {"hint": "", "status": "OK"}, "directories": {"hint": "", "status": "OK"}, "failed_backups": {"hint": "there are 0 failed backups", "status": "OK"}, "minimum_redundancy_requirements": {"hint": "have 10 backups, expected at least 1", "status": "OK"}, "pg_receivexlog": {"hint": "", "status": "OK"}, "pg_receivexlog_compatible": {"hint": "", "status": "OK"}, "postgresql": {"hint": "", "status": "OK"}, "postgresql_streaming": {"hint": "", "status": "OK"}, "receive_wal_running": {"hint": "", "status": "OK"}, "replication_slot": {"hint": "", "status": "OK"}, "retention_policy_settings": {"hint": "", "status": "OK"}, "ssh": {"hint": "PostgreSQL server", "status": "OK"}, "superuser_or_standard_user_with_backup_privileges": {"hint": "", "status": "OK"}, "systemid_coherence": {"hint": "", "status": "OK"}, "wal_level": {"hint": "", "status": "OK"}}}

But Zabbix cannot process the JSOn data and giving this error message ;

image

Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "-db01.archive_command.status".
Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "-db01.archive_mode.status".
Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "-db01.archiver_errors.status".
Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "-db01.backup_maximum_age.status".
Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "-db01.compression_settings.status".

The system is running on Centos7 / Zabbix 5.0.3 and Barman .

Thank you.

@stefanheykes
Copy link
Contributor

Hi @mbuyukkarakas

I tried to test the preprocessing in my Zabbix with your values, that does not give any errors but an expected output.

Database discovery:
Screenshot from 2021-03-03 13-06-21
Archive Command:
Screenshot from 2021-03-03 13-11-45

So I am sorry, but I do not see the reason for the error, your input value seems to be quite ok and to be processed correctly
(also running on CentOS 7 / Zabbix 5.0.7)
Can you maybe to the same tests on your system? maybe we can already see then something going wrong

@mbuyukkarakas
Copy link
Author

Thank you. I will try to upgrade zabbix to higher minor versions than try again.

@CarlosARAlmeida
Copy link

Hi! Great project! I have a question, I would be happy if I could answer.

Is there any version for Zabbix 4?

Another question, how can i resolve this error, during import template?

Captura de Tela 2021-04-19 às 17 51 28

Tks!

@stefanheykes
Copy link
Contributor

Hi @CarlosARAlmeida,
there are no plans to make this available for Zabbix <5 on our side as we have no Zabbix 4 system running/available. If someone gets it running on Zabbix 4 with this or a slightly modified version I would however happily merge a pull request here.

With which version did you experience the error in your screenshot?

@CarlosARAlmeida
Copy link

I will update my Zabbix to >5, but not now.

This error was tried adapt you template to Zabbix 4, I'll try a few more times if i get something, I'll let you know.

Thank you very much for responding!

@lptarik
Copy link

lptarik commented May 11, 2021

Getting error like this.

image

@DavidPavlicek
Copy link

Recently I run across the same issue (#1: unsupported construct in JSON path starting with: "-gis-pg02.archive_command.status"). I was able to solve that by replacing unquoted JSON path accessors in item prototypes preprocessing with their quoted variants.

Instead of:
$.{#BARMAN.BACKUP}.archive_command.status

there should be:
$.['{#BARMAN.BACKUP}'].archive_command.status

and so on, for each item prototype.

Without quotes, it is possible that provided macro value is not compatible with JSON path "simple" dot accessors.

@lptarik
Copy link

lptarik commented May 21, 2021

Recently I run across the same issue (#1: unsupported construct in JSON path starting with: "-gis-pg02.archive_command.status"). I was able to solve that by replacing unquoted JSON path accessors in item prototypes preprocessing with their quoted variants.

Instead of:
$.{#BARMAN.BACKUP}.archive_command.status

there should be:
$.['{#BARMAN.BACKUP}'].archive_command.status

and so on, for each item prototype.

Without quotes, it is possible that provided macro value is not compatible with JSON path "simple" dot accessors.

Worked for me thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants