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

Making plugin - Function to check if hostname exists

Scheduled Pinned Locked Moved General
2 Posts 2 Posters 1.3k Views
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.
  • A
    Alipio Luiz
    last edited by Jun 14, 2012, 3:42 AM

    Hi there… I’m making a plugin for FOG… I know there is a function called hostsExists to check if a mac address exists in the hosts table… however, is there any function to check if the hostname exists?

    Regards,
    Alipio Luiz

    1 Reply Last reply Reply Quote 0
    • B
      Blackout Developer
      last edited by Jul 11, 2012, 9:44 PM

      Code for 0.33 BETA
      [code]// Within a FOG Class
      $hostExists = $this->getClass(‘HostManager’)->exists(array(‘name’ => ‘chicken’)));

      // Outside of a FOG Class
      $hostExists = $GLOBALS[‘FOGCore’]->getClass(‘HostManager’)->exists(array(‘name’ => ‘chicken’)));[/code]

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

      223

      Online

      12.3k

      Users

      17.4k

      Topics

      155.9k

      Posts
      Copyright © 2012-2025 FOG Project