Re: very simple exec usage

Charles Sprickman <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On Mon, 16 Apr 2007, Dave Shield wrote:

> On 13/04/07, Charles Sprickman <[email protected]> wrote:
>> In snmpd.conf I have something like this:
>>
>> exec .1.3.6.1.4.1.2021.9100.1 QmailQueue1 /usr/local/adm/bin/qm-stat-cat.sh 1
>> exec .1.3.6.1.4.1.2021.9100.2 QmailQueue2 /usr/local/adm/bin/qm-stat-cat.sh 2
>> exec .1.3.6.1.4.1.2021.9100.3 QmailQueue3 /usr/local/adm/bin/qm-stat-cat.sh 3
>>
>> It does work, but I'm totally lost on how to make sure these values, which
>> are always integers are reported as such.
>
>> toolbox[~]# snmpwalk -v1 -c foo h07 1.3.6.1.4.1.2021.9100.1.101.8
>> UCD-SNMP-MIB::ucdavis.9100.1.101.8 = STRING: "0"
>
> The agent does not know what output will be produced by an arbitrary
> command, so always reports it as a string.  This means that MRTG, etc
> cannot generate a graph from it.

Additionally things like some of the Nagios snmp checks will get upset 
about seeing a string when you want to look at a number (ie: check_snmp 
can alert you if something is out of range, but on a string, it's always 
out of range).

> You'd need to adjust the 'qm-stat-cat' script to return the numeric
> value as the *exit* status from the script, and then retrieve (and monitor)
> the OID UCD-SNMP-MIB::ucdavis.9100.1.100

OK, now I understand what you're saying.  The problem I have is that this 
script is looking at qmail queues and grabbing some custom stats - and 
it's got a multi-line output, kind of like so:

/var/log/qmail/qmail1/current
400/400
66234
1766
69
68069
3
0
68069

And we have from 1 to 9 queues on each host...  So I'd be looking at a 
pretty major restructuring of how we do this.  I saw another poster had a 
quick hack/fix for mrtg; have mrtg run a script that wraps around snmpget 
and you're set.  But then we still have to deal with nagios and the like.

If I really want to have certain lines in a script that returns multiple 
lines be reported as integers, is there *anything* I can do to force that?

Is there something beyond exec and extend that would make more sense?

Thanks,

Charles

> Dave
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Net-snmp-users mailing list
> [email protected]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.