Modify client to do system inventory on PXE boot



  • I’d like to adapt the FOG client to take an inventory automatically after PXE boot. I’ve unpacked the init.gz and had a look around, but I’m unsure of the next steps. What would be the best strategy to:

    • run the DMI report
    • run the partitions report for all local drives
    • tarball/zip the results and FTP them

    TIA for any pointers

    Bart…


  • Moderator

    Right now, the inventory task ends with a clearing of the task file and a reboot. If you want to perform an inventory and then do more stuff, I think you’ll have to modify that behavior without interfering with the rest of the tasks that call the inventory scripts.



  • Dude… That’s a top idea…

    Please let me know if you have any success…

    I too have heavily modified fog to do extra stuff, if only there was a way to combine all these customizations…



  • @Bryce,

    @Chad, yes indeed, basically I want to use the PXE image to get the hardware info and then change the host to point the client to an image based on that info.

    I’ll have a look at the init.d scripts and update this thread

    Thanks,

    Bart…


  • Moderator

    Are you wanting to take an inventory every time the computer PXE boots?



  • Off the top of my head I’d suggest editing /etc/init.d/S99fog and adding a conditional statement like
    [CODE]if [ “$mode” != “inventory” ]; then
    sh /bin/fog.inventory;[/CODE]
    before the rest of the $mode checks.

    So…
    [CODE]afterActionTerm=“reboot -f”;
    if [ “$shutdown” = “on” ]
    then
    afterActionTerm=“poweroff”;
    fi

    if [ “$mode” == “debug” ]; then
    [/CODE]

    becomes…

    [CODE]afterActionTerm=“reboot -f”;
    if [ “$shutdown” = “on” ]
    then
    afterActionTerm=“poweroff”;
    fi

    if [ “$mode” != “inventory” ]; then
    sh /bin/fog.inventory;

    if [ “$mode” == “debug” ]; then
    [/CODE]

    Warning: That was off the top of my head and has not been tested.


Log in to reply
 

349
Online

39.3k
Users

11.0k
Topics

104.4k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.