تنصيب pnp4nagios كإضافة ل Nagios (الجزء الثاني)
pnp4nagios هو برنامج أو بالأحرى إضافة ل nagios تساعدنا على معرفت البيانات بخط زمني وهو برنامج مفتوح المصدر
تنصيب التطبيقات التي يحتاجها pnp4nagios
apt-get install librrd-dev librrds-perl librrdp-perl
تنصيب pnp4nagios
تحميل البرنامج أو الحزمة من هنا أخر إصدارأخر إصدار أستعمل 0.6.0
# wget http://downloads.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.0.tar.gz
# tar xvzf pnp4nagios-0.6.0.tar.gz
# cd pnp4nagios-0.6.0
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
# make all
تنصيب pnp4nagios
يمكننا إستعمال الثلاثة
# make install
# make install-config
# make install-init
# make fullinstall
التعديلات
تغيير أسماء بعض الملفات التي سنقوم بإحتياجها# mv /usr/local/pnp4nagios/etc/rra.cfg-sample /usr/local/pnp4nagios/etc/rra.cfg
# mv /usr/local/pnp4nagios/etc/npcd.cfg-sample /usr/local/pnp4nagios/etc/npcd.cfg
# mv /usr/local/pnp4nagios/etc/process_perfdata.cfg-sample /usr/local/pnp4nagios/etc/process_perfdata.cfg
# mv /usr/local/pnp4nagios/etc/check_commands/check_nwstat.cfg-sample /usr/local/pnp4nagios/etc/check_commands/check_nwstat.cfg
# mv /usr/local/pnp4nagios/etc/pages/web_traffic.cfg-sample /usr/local/pnp4nagios/etc/pages/web_traffic.cfg
فتح nagios.cfg
# vim /usr/local/nagios/etc/nagios.cfg
process_performance_data=1
enable_environment_macros=1
service_perfdata_command=process-service-perfdata
host_perfdata_command=process-host-perfdata
service_perfdata_file=/usr/local/pnp4nagios/var/perfdata/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file
host_perfdata_file=/usr/local/pnp4nagios/var/perfdata/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
broker_module=/usr/local/pnp4nagios/bin/npcdmod.o config_file=/usr/local/pnp4nagios/etc/npcd.cfg
# vim /usr/local/nagios/etc/objects/commands.cfg
define command{
command_name process-host-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out
}
# 'process-service-perfdata' command definition
define command{
command_name process-service-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl
command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out
}
define command{
command_name process-service-perfdata-file
command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/perfdata/service-perfdata
}
define command{
command_name process-host-perfdata-file
command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/perfdata/host-perfdata
}
فتح php.ini
vim /etc/php5/apache2/php.ini
magic_quotes_gpc = On
magic_quotes_gpc = Off
# a2enmod rewrite
# /etc/init.d/apache2 restart
إذا لم يحصل أي خطئ مثل هذا, فذالك جيد
ليست هناك تعليقات:
إرسال تعليق