Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Update URL / Version File

    Scheduled Pinned Locked Moved General pfSense Questions
    3 Posts 2 Posters 663 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.
    • F
      FalSal
      last edited by

      Hello,

      does anyone know the current update URL? Or even the URL to a version file?
      I would like to build a Nagios plugin to check if there is an update for my pfsense.

      Thanks and greetings,
      FalSal

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan
        last edited by

        Hi,

        According the manual, this file /var/run/pfSense_version contains info according the fact that an update is present (or an error, or something else).

        If you want to know more, or even question "the source" yourself, start reading the manual (like your nagios script, these are also scripts using world's most simple language : Basi … no => PHP !) and drill down to the point where it is happening.

        Btw : you are aware of the fact that pfSense (Netgate actually, I guess) will send you a mail when the latest and greatest comes out ?!

        You could also parse the RSS reader (teh widget).

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • F
          FalSal
          last edited by

          Thanks!

          
          #!/usr/local/bin/php -f
          #
          # Script to check the Version and print a Output in the Nagios-Plugin-Syntax
          #
          
          require("globals.inc");
          require("config.inc");
          require("functions.inc");
          require_once("pkg-utils.inc");
          
          $system_version = get_system_pkg_version(true, false);
          $iCheckExitCode = 3;
          
          if (!is_array($system_version) || !isset($system_version['version']) || !isset($system_version['installed_version'])) {
          
                  echo "Uknown - Error in version information";
                  exit( $iCheckExitCode );
          
          }
          
                  switch ($system_version['pkg_version_compare']) {
                  case '<':
                          echo "Critical -  Version " . $system_version['version'] . " is available.";
                          $iCheckExitCode = 2;
                          break;
                  case '=':
                          echo "Ok - The system is on the latest versioni (" . $system_version['installed_version'] . ").";
                          $iCheckExitCode = 0;
                          break;
                  case '>':
                          echo "Warning - The system is on a later version than official release.";
                          $iCheckExitCode = 1;
                          break;
                  default:
                          echo "Unknown - Error comparing installed with latest version available";
                          $iCheckExitCode = 3;
                          break;
                  }
          
          exit( $iCheckExitCode );
          
          ?>
          
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.