Icon_image

Hi,

I found the custom attribute icon_image which works perfekt with the icons from /usr/share/icingaweb2/public/img/icons.
I want to use some of my own icons and coby them to the directory, but there is no view on icingaweb2.

Any ideas why custom icons dont work?

You should be able to place your own icons beneath /usr/share/icingaweb2/public somewhere. Though preferably a custom directory (path) as Web 2’s paths are managed by packages.

Then use the path relative to .../public (e.g. .../public/your/icon.png would be your/icon.png) and Web 2 should display the icons.

2 Likes

I created a custom directory beneath …/public

/usr/share/icingaweb2/public/custom#

drwxr-xr-x 6 root root 4096 Oct 30 2018 css
drwxr-xr-x 2 root root 4096 May 2 13:01 custom
-rw-r–r-- 1 root root 43 Aug 2 2018 error_norewrite.html
-rw-r–r-- 1 root root 418 Aug 2 2018 error_unavailable.html

My icon is placed in this directory:
/usr/share/icingaweb2/public/custom# ll
total 4
-rw-r–r-- 1 root root 1106 May 2 12:10 icons8-wi-fi-16.png

My template:

template Host "cisco-wlc" {
    import "generic-host"
    icon_image =    "custom/icons8-wi-fi-16.png"
    vars.sla = "24x7"

Unfortunately no displayed icon :frowning:

Works very well for me. What does your browser show if you access the icon directly? (<host>/icingaweb2/custom/icons8-wi-fi-16.png)

2 Likes

oh I missed a letter… :man_facepalming::man_facepalming:
It works very fine!!!

Thank you very much!

Which permissions are set for directory and image?

/usr/share/icingaweb2 and all files and sub-directories belong to user&group root with 755 permissions for the directories and 744 permissions for the files.
So the icons under /usr/share/icingaweb2/public/img/icon have 744 permissions

In training a couple of weeks back, the trainer showed a way to display all available icons from within Icinga Web, but I can’t recall what that page was.
Would anyone know?
Thank you,
Jean

/doc/style/font, only available with an enabled doc module.

1 Like

Thanks a lot, nice page, but this was not the one. The page the trainer showed was one with all icons, in colour, with their xxx.png name.

Could you ask the trainer?

There is no public interface for that but this might help:

for example:

https://your-icinga/icingaweb2/img/icons/tux.png

is

/usr/share/icingaweb2/public/img/icons/tux.png

Would be great if https://your-icinga/icingaweb2/img/icons/ would just show all of them.

First approach: add the following to /etc/httpd/conf/httpd.conf:

<Directory "/usr/share/icingaweb2/public/img/icons">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>

After an httpd restart, the page https://your-icinga/icingaweb2/img/icons/ will then show the list of files names without the pictures, but a click on the name will show the picture.

Second approach: copy the icons directory on a workstation and view the files in a file browser. Much more effective :wink:

Sure, but did you have any luck asking the trainer?

Yes, I did ask, and he did reply. He doesn’t remember demonstrating anything similar.

1 Like