Sponsored Content
Special Forums UNIX and Linux Applications Infrastructure Monitoring Zabbix Template and PERL Script for Monitoring Apache2 Post 302296128 by Neo on Tuesday 10th of March 2009 12:14:51 PM
Old 03-10-2009
Version 2: Zabbix Template and PERL Script for Monitoring Apache2

Based on a recommendation at the Zabbix forums, we updated this 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,cut -f1 -d":" /tmp/apache_data.txt
UserParameter=apache2.total_kbytes,cut -f2 -d":" /tmp/apache_data.txt
UserParameter=apache2.cpuload,cut -f3 -d":" /tmp/apache_data.txt
UserParameter=apache2.uptime,cut -f4 -d":" /tmp/apache_data.txt
UserParameter=apache2.reqpersec,cut -f5 -d":" /tmp/apache_data.txt
UserParameter=apache2.bytespersec,cut -f6 -d":" /tmp/apache_data.txt
UserParameter=apache2.bytesperreq,cut -f7 -d":" /tmp/apache_data.txt
UserParameter=apache2.busyworkers,cut -f8 -d":" /tmp/apache_data.txt
UserParameter=apache2.idleworkers,cut -f9 -d":" /tmp/apache_data.txt
UserParameter=apache2.totalworkers,cut -f10 -d":" /tmp/apache_data.txt

Basically, we have moved the PERL script to a crontab running every minute and we then write the results to a /tmp file. Then the Zabbix agent reads the data from the file instead of calling the PERL script 10 times. This is more efficient.

Also, we change the template to update every 60 seconds instead of 30 seconds to match the crontab entry.

Files attached. If you have any questions, please post here.
This User Gave Thanks to Neo For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Log Monitoring through Perl

Hi, I am new to perl. I want to write a perl script to monitor logs. Where i want to monitor exceptions logged or any kind of error strings. I have a dir(On Solaris) with multiple log file which keeps rolling to .gz file after some time in that same dir. These logs files size keeps on... (0 Replies)
Discussion started by: solitare123
0 Replies

2. UNIX for Dummies Questions & Answers

Perl Scripting for monitoring logs

Hi, I am new to perl. I want to write a perl script to monitor logs. Where i want to monitor exceptions logged or any kind of error strings. I have a dir(On Solaris) with multiple log file which keeps rolling to .gz file after some time in that same dir. These logs files size keeps on... (1 Reply)
Discussion started by: solitare123
1 Replies

3. Infrastructure Monitoring

A Review of Zabbix - Zabbix Rules! (Part 1)

Tim Bass 03-20-2009 07:02 AM Source... (0 Replies)
Discussion started by: Linux Bot
0 Replies

4. Infrastructure Monitoring

A Review of Zabbix - Zabbix Rules! (Part 2)

Tim Bass 03-23-2009 03:45 PM Source... (0 Replies)
Discussion started by: Linux Bot
0 Replies

5. Programming

Perl script to create latex template.

Hi, I have XML file and I extracted some tags and stored in hash, my data as look like this $var1={ 'stud.xml'={ '24'=>'<address> <streetname="xxxx"/> <housenum="138"/"> ... (9 Replies)
Discussion started by: veerubiji
9 Replies

6. Programming

need help in perl template toolkit module.

Hi how can I read this information using template toolkit $var1= { 'STC'=> }; I am not able to get this type of complex data , Remaining everything I solved and I am getting output as I want but this problem suffers me.please help me. (0 Replies)
Discussion started by: veerubiji
0 Replies

7. Shell Programming and Scripting

Help with FTP Monitoring Using Perl

Hi, Can anyone help me to start a monitoring script in perl of a FTP server. (2 Replies)
Discussion started by: phanik143
2 Replies

8. Shell Programming and Scripting

Script to complete all fields of template

Hello gurus; I need to do a script to complete a technical template and I don't have idea to how to do :wall: I've try with bash and awk or sed but my brain is empty in this script. I need help please. The incoming file is a csv with an index number, first occurence in the possition of the... (2 Replies)
Discussion started by: renderuas
2 Replies
A2ENMOD(8)                                                    System Manager's Manual                                                   A2ENMOD(8)

NAME
a2enmod, a2dismod - enable or disable an apache2 module SYNOPSIS
a2enmod [ [-q|--quiet] module] a2dismod [ [-q|--quiet] module] DESCRIPTION
This manual page documents briefly the a2enmod and a2dismod commands. a2enmod is a script that enables the specified module within the apache2 configuration. It does this by creating symlinks within /etc/apache2/mods-enabled. Likewise, a2dismod disables a module by removing those symlinks. It is not an error to enable a module which is already enabled, or to disable one which is already disabled. Note that many modules have, in addition to a .load file, an associated .conf file. Enabling the module puts the configuration directives in the .conf file as directives into the main server context of apache2. OPTIONS
-q, --quiet Don't show informative messages. -m, --maintmode Enables the maintainer mode, that is the program invocation is effectuated automatically by a maintainer script. This switch should not be used by end users. -p, --purge When disabling a module, purge all traces of the module in the internal state data base. EXIT STATUS
a2enmod and a2dismod exit with status 0 if all modules are processed successfully, 1 if errors occur, 2 if an invalid option was used. EXAMPLES
a2enmod imagemap a2dismod mime_magic Enables the mod_imagemap module, and disables the mod_mime_magic module. FILES
/etc/apache2/mods-available Directory with files giving information on available modules. /etc/apache2/mods-enabled Directory with links to the files in mods-available for enabled modules. SEE ALSO
apache2ctl(8), a2enconf(8), a2disconf(8). AUTHOR
This manual page was written by Daniel Stone <daniel@sfarc.net> for the Debian GNU/Linux distribution, as it is a Debian-specific script with the package. 12 October 2006 A2ENMOD(8)
All times are GMT -4. The time now is 05:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy