nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ require('filter.inc'); function nrpe2_custom_php_install_command() { global $g, $config; conf_mount_rw(); $ip = $config['interfaces']['lan']['ipaddr']; $config['installedpackages']['nrpe2']['config'][0]['enabled'] = TRUE; $config['installedpackages']['nrpe2']['config'][0]['server_address'] = $ip; $config['installedpackages']['nrpe2']['config'][0]['server_port'] = 5666; $config['installedpackages']['nrpe2']['config'][0]['allowed_hosts'] = "127.0.0.1"; $config['installedpackages']['nrpe2']['config'][0]['row'] = array( 0 => array( 'name' => 'check_users', 'command' => 'check_users', 'warning' => '5', 'critical' => '10' ), 1 => array( 'name' => 'check_load', 'command' => 'check_load', 'warning' => '15,10,5', 'critical' => '30,25,20', ), 2 => array( 'name' => 'check_root', 'command' => 'check_disk', 'warning' => '20%', 'critical' => '10%', 'extra' => '-p /' ), 3 => array( 'name' => 'check_var', 'command' => 'check_disk', 'warning' => '20%', 'critical' => '10%', 'extra' => '-p /var/run' ), 4 => array( 'name' => 'check_zombie_procs', 'command' => 'check_procs', 'warning' => '5', 'critical' => '10', 'extra' => '-s Z' ), 5 => array( 'name' => 'check_total_procs', 'command' => 'check_procs', 'warning' => '150', 'critical' => '200' ) ); $fd = fopen('/usr/local/etc/rc.d/nrpe2', 'w'); $rc_file = <<