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

mysql query for user tracking

Scheduled Pinned Locked Moved
General Problems
3
4
442
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.
  • G
    Greg Plamondon Testers
    last edited by Jun 21, 2022, 2:37 PM

    Can anyone help me with a Mysql query to track users?
    I would like to search by username.

    The reason I am asking is the user tracking function is giving me fits, we have a very large database.

    Thanks.

    G 1 Reply Last reply Jun 21, 2022, 8:52 PM Reply Quote 0
    • G
      george1421 Moderator @Greg Plamondon
      last edited by Jun 21, 2022, 8:52 PM

      @greg-plamondon Forgive my ignorance, track users against what? (this maybe an unused feature to me in FOG). To know what tables to hit, I need something fog knows about.

      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!

      G 1 Reply Last reply Jun 22, 2022, 4:57 PM Reply Quote 0
      • G
        Greg Plamondon Testers @george1421
        last edited by Jun 22, 2022, 4:57 PM

        @george1421
        I need to know what PC a user has logged into.
        you can find it in the GUI under Reports > User Tracking

        from there you can type a users login ID ito the field and search it will list what PC the user has logged into.

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by Jun 22, 2022, 7:09 PM

          @Greg-Plamondon Try these queries:

          Get a list of (unique) host IDs where username logged in to:

          SELECT DISTINCT utHostID FROM userTracking WHERE utUserName LIKE '%username%';
          

          Now combine this query to get the list of hostnames as well:

          SELECT hostID,hostName FROM hosts WHERE hostID IN (SELECT DISTINCT utHostID FROM userTracking WHERE utUserName LIKE '%username%');
          

          Be aware that the first query might return more results than the later one because older user tracking entries will still exist even if you delete a host from your database. In that case the later query won’t return this host.

          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 1
          • 1 / 1
          1 / 1
          • First post
            1/4
            Last post

          169

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project