add framework for new cron features; add ability to update librenms daily

This commit is contained in:
Tyler Christiansen
2013-11-03 22:16:01 -08:00
parent bec68c8d5d
commit ab5feaee2f
5 changed files with 26 additions and 0 deletions

View File

@@ -39,5 +39,7 @@ $config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth
#$config['nets'][] = "172.16.0.0/12";
#$config['nets'][] = "192.168.0.0/16";
# Uncomment the next line to disable daily updates
#$config['update'] = 0;
?>

15
daily.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
/*
* Daily Task Checks
* (c) 2013 LibreNMS Contributors
*/
include('includes/defaults.inc.php');
include('config.php');
$options = getopt("f:");
if ( $options['f'] === 'update') { echo $config['update']; }
?>

5
daily.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
if [ $(php daily.php -f update) -eq 1 ]; then
git pull --no-edit --quiet
fi

View File

@@ -542,4 +542,7 @@ $config['modules_compat']['rfc1628']['netmanplus'] = 1;
$config['modules_compat']['rfc1628']['deltaups'] = 1;
$config['modules_compat']['rfc1628']['poweralert'] = 1;
# Enable daily updates
$config['update'] = 1;
?>

View File

@@ -1,3 +1,4 @@
33 */6 * * * root /opt/librenms/discovery.php -h all >> /dev/null 2>&1
*/5 * * * * root /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5 * * * * root /opt/librenms/poller.php -h all >> /dev/null 2>&1
15 0 * * * root sh /opt/librenms/daily.sh > /dev/null 2>&1