Link to home
Start Free TrialLog in
Avatar of AXISHK
AXISHK

asked on

update OID with a particular value in RedHat

Is it possible to update a OID with a value such that it can be retrieved with snmpwalk ? The value is in fact couting the unique from a apache log. Tks
Avatar of arnold
arnold
Flag of United States of America image

What do you mean update?
First you have to have a write community with which you are setting.
The other the OID has to be read/write capable.

You can setup an OID within snmpd.conf that will trigger a script that does what you want and returning the value to the snmpwalk process.

Look at the other examples within /etc/snmp/snmpd.conf

that define how to get a response for a specific OID.
Avatar of AXISHK
AXISHK

ASKER

I have created a script to analyze the number of invalid request from apache log within last 5 min. And I want to put this value into OID such that it can be displayed on MRTG. There existing a MRTG graph that can do similar kind of thing but I have no idea how to create it. Any idea ?
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AXISHK

ASKER

I only need to setup syslog-ng server, correct ?

Do I need to configure anything on apache server, say the Apache configuration file - httpd.conf under /etc/httpd/conf.d ?

Tks
Apache needs to be instructed to log error logs and transfer log to syslog.
IMHO, you can do with rsyslog most anything,  what is it that attracts you syslog-ng.

All the information to answer your question has been posted.

Apache uses syslog facility local6
Rsyslog is configured to
Local6.* @central_syslog_server
Local6.* also_write_to_local_file
Local6.* can also pass this data to a program that will generate database entries, email notices, whatever you can think of. Including generate an SNMP trap to a monitor application that a particular preconfigured event/s occurred.
Avatar of AXISHK

ASKER

Current operation is using syslog-ng. Hence, I can change it.
Sorry for keeping asking for the question, but I really have no idea where I can configure it....

"Apache uses syslog facility local6
 Rsyslog is configured to...."
 
Do you mean configure syslog on Apache to forward it to my centralized Syslog_NG ? Tks
Apache httpd.conf configures Apache to log locally to the local syslog/rsyslog.
The local syslog is then configured to forward what it receives to your central syslog server.

It seems this question us devolving to a non related of your other questions.
Your snmpd.conf needs to reference a script that will either crunch the data when polled, or pull data from a flat file, while there is another process that crunches data.