Creating data input methods

We have already seen how to create a data input method for simple SNMP queries. Let's look into creating a script-based data input method for retrieving some information out of the secure log file. The secure log file contains information about failed and successful logins. Please note that the following example will only work on a Linux system.

Preparation—creating the script

For a script/command data input method, you obviously need a script for gathering the required data and providing it to Cacti. Look at the unix_secure_log.pl file. This Perl script will collect the necessary data for you.

Let's have a look at the commands used in the script. Within the first line of interest, you configure the path and filename to ...

Get Cacti 0.8 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.