Update URL / Version File



  • 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



  • 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).



  • 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 );
    
    ?>
    
    

Log in to reply