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

Icinga Reporting function not found #170

Closed
Bastilla123 opened this issue Jan 4, 2023 · 4 comments
Closed

Icinga Reporting function not found #170

Bastilla123 opened this issue Jan 4, 2023 · 4 comments
Labels
no-issue This doesn't seem right

Comments

@Bastilla123
Copy link

Bastilla123 commented Jan 4, 2023

After the installation of Reporting module setting database for reporting which is different between icinga_ido database.

When I'm openning Reporting tab after all configuration and choosing before configured report - I see an error:

SQLSTATE[42883]: Undefined function: 7 ERROR: function idoreports_get_sla_ok_percent(bigint, unknown, unknown, unknown) does not exist
LINE 1: ...lay_name, s.display_name AS service_display_name, idoreports...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts., query was: SELECT h.display_name AS host_display_name, s.display_name AS service_display_name, h.display_name AS host_display_name, s.display_name AS service_display_name, idoreports_get_sla_ok_percent(so.object_id, '2023-01-04 04:42:24', '2023-01-04 08:42:24', NULL) AS sla FROM icinga_objects AS so
INNER JOIN icinga_services AS s ON s.service_object_id = so.object_id AND so.is_active = 1 AND so.objecttype_id = 2
INNER JOIN icinga_hosts AS h ON h.host_object_id = s.host_object_id ORDER BY LOWER(h.display_name) ASC, LOWER(s.display_name) ASC (Pdo.php:225)

I import both:

psql -U icinga2 icinga2 < schema/postgresql/slaperiods.sql
psql -U icinga2 icinga2 < schema/postgresql/get_sla_ok_percent.sql

i set all Users in postgresql with Superadmin rights.

I make on all users following:

GRANT EXECUTE ON FUNCTION idoreports_get_sla_ok_percent TO username;

I have no idea why i get this error.

Why in function parameter stand (bigint, unknown, unknown, unknown)?

When i login per psql in icinga2 database and execute following query:

select idoreports_get_sla_ok_percent(1,now()::timestamp,now()::timestamp,NULL);

Function can be execute....

I am very sure that problem is parameter signature (bigint, unknown, unknown, unknown) because postgresql function expects folowing signature id bigint, starttime timestamp without time zone, endtime timestamp without time zone, sla_id integer DEFAULT NULL::integer

@lippserd
Copy link
Member

lippserd commented Jan 4, 2023

The functions have to be imported into the Icinga 2 database.

@Bastilla123
Copy link
Author

It is import in icinga2 main database... I have also try to import on another database but only in icinga2 main database it is importable...

@yhabteab
Copy link
Member

If you have followed these installation steps for Icinga 2 - PGSQL, you do not need to grant any additional privileges. You just have to import the function as described in the documentation to the appropriate database.

What does this command output?

psql -U icinga2 -d icinga2 -c "SELECT routine_name FROM information_schema.routines WHERE routine_type = 'FUNCTION' AND routine_schema = 'public';"

@yhabteab
Copy link
Member

No feedback from OP over a week, so I'm assuming it's been resolved.

@lippserd lippserd closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2023
@lippserd lippserd added the no-issue This doesn't seem right label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants