Log File -> cacti

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
chewymix
Posts: 10
Joined: Fri May 27, 2005 10:41 am

Log File -> cacti

Post by chewymix »

Hi

I have a script that gets connected oracle user numbers and puts them into a log file. How can i take this log file and import it into cacti?

thanks
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Re: Log File -> cacti

Post by fmangeant »

chewymix wrote:I have a script that gets connected oracle user numbers and puts them into a log file. How can i take this log file and import it into cacti?
Hi

a simple setup (on Unix) would be :

- create a script /tmp/display_log.sh

Code: Select all

#!/bin/sh

cat /tmp/mylog.txt
- add this line to /etc/snmp/snmpd.conf :

Code: Select all

exec .1.3.6.1.4.1.2021.400 /bin/sh /tmp/display_log.sh
You can then get the output like this :

Code: Select all

# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.400
UCD-SNMP-MIB::ucdavis.400.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.400.2.1 = STRING: "/bin/sh"
UCD-SNMP-MIB::ucdavis.400.3.1 = STRING: "/tmp/display_log.sh"
UCD-SNMP-MIB::ucdavis.400.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.400.101.1 = STRING: "123"
UCD-SNMP-MIB::ucdavis.400.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.400.103.1 = ""
In this example, the OID for the content of your log is .1.3.6.1.4.1.2021.400.101.1

On a Windows host, you can use NRPE (Nagios Remote Plugin Executor). Here's a nrpe.cfg sample file :

Code: Select all

command[display log]=c:\windows\system32\type c:\temp\mylog.txt"
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests