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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
AXISHKAuthor Commented:
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 ?
Mrtg when configured will query the script, it makes inculcate to have mrtg probe an SNMP oid that you create.
When you run snmpwalk on this OID /script.  Usually the response mrtg is waiting for is a three value set
Min, max, cure.
Does your script only count the ones that were received since the last timetheprocess ran or it reports the total based on the file from which it reads?

I.e. In snmpd.conf

Exec oid return_count_script

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

AXISHKAuthor Commented:
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 ?

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.
AXISHKAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.