Additional Information in Hosts


  • Hello guys,

    is it possible to add an additional column with the information from host-inventory?
    For example the “System Product”.
    That could safe multiple steps to find out, which image should be assigned to which host.

    Thanks

  • Moderator

    @Oleg I hope you can read patch/diff information. Here are the changes you need to make to /var/www/html/fog/lib/pages/hostmanagementpage.class.php to add the “System Product” column to the host list output - this is for FOG 1.5.9 and would probably work in 1.5.8 just as well:

    --- fogproject-master/packages/web/lib/pages/hostmanagementpage.class.php	2020-09-14 01:00:12.000000000 +0200
    +++ /var/www/html/fog/lib/pages/hostmanagementpage.class.php	2020-12-19 17:03:24.225580767 +0100
    @@ -175,7 +175,8 @@
                 _('Host'),
                 _('Imaged'),
                 _('Task'),
    -            _('Assigned Image')
    +            _('Assigned Image'),
    +            _('System Product')
             );
             $this->templates = array(
                 '<i class="icon fa fa-question hand"></i>',
    @@ -223,7 +224,9 @@
                     _('Goto task list')
                 ),
                 '<small><a href="?node=image&sub=edit&id=${image_id}">'
    -            . '${image_name}</a></small>'
    +            . '${image_name}</a></small>',
    +            '${inventory}'
    +            
             );
             unset($up, $down, $mc);
             $this->attributes = array(
    @@ -259,6 +262,9 @@
                 ),
                 array(
                     'width' => 20
    +            ),
    +            array(
    +                'width' => 120
                 )
             );
             /**
    @@ -281,6 +287,7 @@
                     'image_id' => $Host->imageID,
                     'image_name' => $Host->imagename,
                     'pingstatus' => $Host->pingstatus,
    +                'inventory' => $Host->inventory->sysproduct,
                 );
                 unset($Host);
             };
    

    I suggest you keep a copy of this information somewhere so you can apply the changes whenever you update to a new version of FOG.


  • @sebastian-roth Thanks!

  • Moderator

    @Oleg I will post the information as soon as I find some more time. Probably on Friday this week.


  • @sebastian-roth we have multiple installations - the most are currently on 1.5.8 and some on 1.5.9. But the changes in the web-ui shouldn’t be that huge

  • Moderator

    @Oleg What do you mean by 1.5.8/9? More than one installation and different versions or a 1.5.8 install with manual adjustments towards 1.5.9 added?


  • @sebastian-roth That would be nice - we use 1.5.8/9 currently.

  • Moderator

    @Oleg Don’t think we’ll add that to the official code as it would spawn a discussion on which fields should be added for everbody’s like.

    But I can give you some instructions for you to modify the code. Would you be interested in that? Which version of FOG do you use?


  • @Sebastian-Roth
    Yes just show it in the Web-UI

  • Moderator

    @Oleg Do you mean a new column in the database or just showing it in the web UI (host list/overview)?

404
Online

9.1k
Users

15.7k
Topics

145.9k
Posts