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
Apache Web ServerLinuxLinux Networking
Last Comment
arnold
8/22/2022 - Mon
arnold
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.
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 ?
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.
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
arnold
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.
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.