Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Jun 17, 2019 2:02 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject:
PostPosted: Fri Jan 04, 2002 6:06 pm 
Offline

Joined: Mon Dec 24, 2001 7:00 pm
Posts: 11
Location: Soest, The Netherlands
Hi,

I want to log the webhits on a webserver that is not running Cacti. I copied the webhits.pl to that host, and i added the following line to the snmpd.conf file on that remote host :
exec .1.3.6.1.4.1.2021.55.15 WebHits /usr/bin/perl /etc/snmp/scripts/webhits.pl

With a snmpget question from the host running Cactie i get the web-hits on the remote host, but is has double quotes like "1233" (snmpget host community .1.3.6.1.4.1.2021.55.15.101.1)

I added an expression to the snmp.pl script ($ret =~s/"//g;) that strips the qoutes from the snmp result, and i added a data-input source and data-source in Cacti that uses the snmp.pl script.

If i looc at the Cron page in Cactie and hit the 'Show Output', then i see a nice figure for the 'gw_webhits' data-source (gw is the remote machine). The problem is that the rra isn't updated with the number i see there. In the logfile i get the following :
01/05/2002 1:02 AM - null data output for dsname gw_webhits
01/05/2002 1:02 AM - CMD: /usr/local/rrdtool/bin/rrdtool update /usr/local/apache/htdocs/cacti/rra/gw_webhits.rrd N:


Doese anyone have any idea on what is going wrong here ? For some reason i cannot get the value into Cacti (or the rra).

Thanx,
Nossie


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 05, 2002 8:55 am 
Offline

Joined: Sat Dec 29, 2001 7:00 pm
Posts: 9
hi,

Ive done exactly the same with the tcp.pl script. However inside the snmpd.conf - i did it slightly different -

#
exec perl /storage/snmp/tcp.pl tcp
exec perl /storage/snmp/tcp.pl
#

i didnt include the OID as you did, and had no problems whatsoever, it allocates automatically, and when you snmpwalk against the .1.3.6.1.4.1.2021.8 you will see the revelent results, and which one to to pu tin your SNMP data source.

[[email protected] rc3.d]# snmpwalk -v 1 localhost public .1.3.6.1.4.1.2021.8
enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1
enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2
enterprises.ucdavis.extTable.extEntry.extNames.1 = perl
enterprises.ucdavis.extTable.extEntry.extNames.2 = perl
enterprises.ucdavis.extTable.extEntry.extCommand.1 = /storage/snmp/tcp.pl tcp
enterprises.ucdavis.extTable.extEntry.extCommand.2 = /storage/snmp/tcp.pl
enterprises.ucdavis.extTable.extEntry.extResult.1 = 0
enterprises.ucdavis.extTable.extEntry.extResult.2 = 0
enterprises.ucdavis.extTable.extEntry.extOutput.1 = 3
enterprises.ucdavis.extTable.extEntry.extOutput.2 = 5
enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0
enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0
enterprises.ucdavis.extTable.extEntry.extErrFixCmd.1 =
enterprises.ucdavis.extTable.extEntry.extErrFixCmd.2 =

So i use these two to collect tcp outbound connections & tcp listening connections:

enterprises.ucdavis.extTable.extEntry.extOutput.1
enterprises.ucdavis.extTable.extEntry.extOutput.2

And can be seen doing a snmpget:

[[email protected] scripts]# snmpget -O neEXbqfsStv yourtargetip public .1.3.6.1.4.1.2021.8.1.101.1
3
[[email protected] scripts]# snmpget -O neEXbqfsStv yourtargetip public .1.3.6.1.4.1.2021.8.1.101.2
5


Craig


<font size=-1>[ This Message was edited by: Craig on 2002-01-05 08:58 ]</font>

<font size=-1>[ This Message was edited by: Craig on 2002-01-05 09:01 ]</font>

<font size=-1>[ This Message was edited by: Craig on 2002-01-05 09:03 ]</font>

<font size=-1>[ This Message was edited by: Craig on 2002-01-05 09:04 ]</font>


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 05, 2002 9:20 am 
Offline

Joined: Mon Dec 24, 2001 7:00 pm
Posts: 11
Location: Soest, The Netherlands
Thanks Craig, everything works now :smile:

If you specify the OID in the snmpd.conf file, it sees the result as a text string (i think), that't why the quotes are there.

Nossie


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group