[ZBX-23851] Bugs in Template 'HPE iLO by HTTP' main item js code Created: 2023 Dec 15  Updated: 2025 Jun 12

Status: Confirmed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Audrius Sadlauskas Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hello,

'Get Data' item code have bugs:

In apiLogout function lines should be changed ( changed line starts with comment)

1. from:

url = encodeURI(ilo.session_url);

to:

url = encodeURI(ilo.params.ilo_url.replace(/\/$/, "") + ilo.session_url);

2. from:

if (request.getStatus() != 200) {

to:

if (request.getStatus() != 204) {

Without these changes apiLogout function always will throw error, especially 1st change. Regarding 2nd it may depend on actuall HP system - better to include all 20* return codes.

Even worse - after several times of usage as sessions will not be deleted it can hit maximum number of connections https://developer.hpe.com/blog/managing-ilo-sessions-with-redfish/

Next just suggestions;

ilo.params.ilo_url should be stored without trailing '/' and relative urls used with starting '/' ,  as every redfish documentation urls shows this way and ilo.session_url is returned with starting '/'.

 

 



 Comments   
Comment by Audrius Sadlauskas [ 2023 Dec 15 ]

Template 'HPE iLO by HTTP' is this one

https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/server/hpe_ilo_http

 

Comment by Oleksii Zagorskyi [ 2023 Dec 22 ]

As I understand, you want to remove "/\/$/" from URL , if it exists there. Right?

Comment by Audrius Sadlauskas [ 2023 Dec 22 ]

Not exactly
ilo.session_url is returned in response and it is relative url - not host part.

And code will never end with success as url is mallformed - no host part.
Therefore host part parameter ilo.params.ilo_url  should be added before relative session url.

ilo.params.ilo_url + ilo.session_url

However ilo.session_url is always returned with starting '/'  ( as it should be for relative urls ) and as code always adds trailing '/' to ilo.params.ilo_url to not have double '//' after host I workarounded this with removing trailing '/' .replace(/\/$/, "") at the end of ilo.params.ilo_url .

E.g.

ilo.params.ilo_url='https://192.168.1.1/'
ilo.session_url='/redfish/v1/SessionService/Sessions/user_1234'

If you simply concatenate strings you will get :

url='https://192.168.1.1//redfish/v1/SessionService/Sessions/user_1234' .

Without my fix code tries to access

url='/redfish/v1/SessionService/Sessions/user_1234'

which never will have success.

Generated at Fri Aug 08 09:52:30 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.