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
Apache Web ServerLinuxLinux Networking

Avatar of undefined
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 ?
ASKER CERTIFIED SOLUTION
arnold

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
arnold

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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.