![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Web Programming, Web 2.0 and Mashups Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, Flash, HTML, SEO, Mashups and other Web APIs and topics. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl Scripting for monitoring logs | solitare123 | UNIX for Dummies Questions & Answers | 1 | 06-25-2008 06:49 AM |
| Log Monitoring through Perl | solitare123 | Shell Programming and Scripting | 0 | 06-25-2008 06:42 AM |
| pERL SCRIPT FOR MONITORING DATE/TIME STAMPS FOR START AND STOP OF APPLICAION IN A LOG | FREDDIE091970 | Shell Programming and Scripting | 4 | 03-31-2008 09:59 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
Zabbix Template and PERL Script for Monitoring Apache2
Hello,
Kindly find attached a copy of the Zabbix template and PERL script we are using to monitor our Apache2 server. Here are the entries for zabbix_agentd.conf Code:
UserParameter=apache2.total_accesses,/etc/zabbix/zabbix_apache2.pl|cut -f1 -d":" UserParameter=apache2.total_kbytes,/etc/zabbix/zabbix_apache2.pl|cut -f2 -d":" UserParameter=apache2.cpuload,/etc/zabbix/zabbix_apache2.pl|cut -f3 -d":" UserParameter=apache2.uptime,/etc/zabbix/zabbix_apache2.pl|cut -f4 -d":" UserParameter=apache2.reqpersec,/etc/zabbix/zabbix_apache2.pl|cut -f5 -d":" UserParameter=apache2.bytespersec,/etc/zabbix/zabbix_apache2.pl|cut -f6 -d":" UserParameter=apache2.bytesperreq,/etc/zabbix/zabbix_apache2.pl|cut -f7 -d":" UserParameter=apache2.busyworkers,/etc/zabbix/zabbix_apache2.pl|cut -f8 -d":" UserParameter=apache2.idleworkers,/etc/zabbix/zabbix_apache2.pl|cut -f9 -d":" UserParameter=apache2.totalworkers,/etc/zabbix/zabbix_apache2.pl|cut -f10 -d":" If you need additional installation instructions or want to report bugs or fixs, feel free to ask or post. |
|
|||||
|
Version 3: Zabbix Scripts for Monitoring Apache2 (+ vBulletin)
We updated this Zabbix template and scripts we are using to monitor our Apache2 server. In this version, we add monitoring for web crawlers (spiders), Treason uncloaked! (TCP bug) and for vBulletin online users stats:
Here are the addition entries for zabbix_agentd.conf Code:
UserParameter=spider.googlebot,cut -f1 -d":" /tmp/zabbix_spiders.dat UserParameter=spider.slurp,cut -f2 -d":" /tmp/zabbix_spiders.dat UserParameter=spider.others,cut -f3 -d":" /tmp/zabbix_spiders.dat UserParameter=vbulletin.totalonline,cut -f1 -d":" /tmp/zabbix_vbulletin.txt UserParameter=vbulletin.membersonline,cut -f2 -d":" /tmp/zabbix_vbulletin.txt UserParameter=vbulletin.guestsonline,cut -f3 -d":" /tmp/zabbix_vbulletin.txt UserParameter=security.treason,cut -f1 -d":" /tmp/zabbix_security.dat This simple one is for detecting spiders with a two minute delay, to give time for the log file to catch up. However, during heavy load times, more delay might be needed: Code:
#!/bin/bash #spiders.sh TIME=`date +%d/%b/%Y:%H:%M` LOG="/website/logs/apache2/access.log" sleep 120 GBOT=`grep "$TIME" "$LOG"| grep Googlebot |wc -l` SLURP=`grep "$TIME" "$LOG"|grep "Yahoo! Slurp" |wc -l` OTHER=`grep "$TIME" "$LOG"|grep -i bot| grep -v "Yahoo! Slurp"|grep -v Googlebot |grep -v Firefox|wc -l` echo $GBOT:$SLURP:$OTHER > /tmp/zabbix_spiders.dat Code:
#!/bin/bash #security.sh TIME=`date +%d/%b/%Y:%k:%M` LOG="/var/log/kern.log" sleep 60 TREASON=`grep "$TIME" "$LOG"| grep -i "Treason Uncloaked" |wc -l` echo $TREASON: > /tmp/zabbix_security.dat Code:
$ourFileName = "/tmp/zabbix_vbulletin.txt"; $zabbixfile = fopen($ourFileName, 'w+'); vfprintf($zabbixfile,"%s:%s:%s\n",array($totalonline,$numberregistered,$numberguest)); fclose($zabbixfile); |
| Sponsored Links | ||
|
|