• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    MySQL and Deleting Hosts

    Scheduled Pinned Locked Moved
    General
    2
    5
    1.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Chris WhiteleyC
      Chris Whiteley
      last edited by

      I was wondering if there would be a command in mysql that would delete hosts if they have no image assigned to them? I am trying to clean up old machines and that is the easiest way to do it. Thanks,

      1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott
        last edited by

        Maybe:

        [code]delete from hosts where hostImage is null;[/code]

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 0
        • Chris WhiteleyC
          Chris Whiteley
          last edited by

          So apparently there is a hostImage attached to them but it doesn’t exist anymore. Is there a way to find out what a particular host has as its hostImage?

          1 Reply Last reply Reply Quote 0
          • Tom ElliottT
            Tom Elliott
            last edited by

            Maybe try hostImage=‘0’ instead of hostImage is null

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            1 Reply Last reply Reply Quote 0
            • Chris WhiteleyC
              Chris Whiteley
              last edited by

              thanks a bunch, I actually used what you did there hostimage=#; and just entered all numbers but the ones we were using and that cleaned it up. Thanks!

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              212

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project