Send statistical data via SNMP

I am working on a SunOS 5.10 Generic_142900-03 sun4v sparc SUNW,Netra-T2000
With this command: (Unix based cronjob)

tail -1 FSC-xxxxxxxxx.stat | nawk -F, '{print $2}' 

I want to send the numeric output of this command from a statistical file which is updating constantly via SNMPv2 every 1 minute to a remote monitoring node. What is the best way to achieve this? :confused:

What monitoring tool is on the remote box?

This is what you have to do - for net-snmp. Creating a trap is a way to do this, but setting the trap up in the monitor is not standard.

TUT:snmptrap - Net-SNMP Wiki

The other way means writing C code - MIB

I am using Lithium Console for Server monitoring. My question is considering that there are the custom SUN SNMP MIBs currently configured can i not edit these to poll just this item of data. Where do i send the result of the
tail -1 FSC-xxxxxxxxx.stat | nawk -F, '{print $2}' command so that is can be send via snmpv2?

I did not get what you wanted. Yes, just modify the MIB code - if it is custom.
Embed the tail - nawk one-liner into a C system() call. Why? you want to synchronize fresh data with the SNMP call.

I am assuming this is an important datum in monitoring and that you are going to change the MIB C.

Or, write the nawk output to a known place that the snmp process can read. Modify the C code to open and read the file. If this does not violate SNMP security policy. Known places are publicly accessible directories like /var/tmp, and /tmp. Be sure the permissions on the file coming out of tail -nawk allows world (other) read, and the directories in the path up to the place where the file lives are world execute.

Is this what you are asking?

BTW - for stuff like this we run an ssh connection to a special snmp-like user on the box in question, and then execute a script. A lot of the console monitoring apps support other protocols than SNMP, among them ftp and ssh. The custom MIB world is not worth it for something like this.

However - Lithium was totally MAC oriented when I saw it demoed. Dunno if the lithium -> lithium core bridge supports anything else like ssh.

I would so very much want to modify existing MIBs. I am trying to figure out one file where snmp polls for its data say number of errors or some instances so that i can map the output of that command to this file. Are you aware of any file which is written to by any script and read from by the snmp agent?