using scripts with cacti
Moderators: Developers, Moderators
using scripts with cacti
Hi,
Currently the system engineer in my company is using scripts to pull data for cpu, hard disk, memory NIC usage etc. Is there a way for cacti to use the same scripts to do the pulling of data rather then using snmp? Cause i'm having problem using snmp to pull data for AIX and solaris. Could someone please advice me how can i do it or where can i find the guide for me to do it? Please advice. thanks a lot.
Regards
Malcum
Currently the system engineer in my company is using scripts to pull data for cpu, hard disk, memory NIC usage etc. Is there a way for cacti to use the same scripts to do the pulling of data rather then using snmp? Cause i'm having problem using snmp to pull data for AIX and solaris. Could someone please advice me how can i do it or where can i find the guide for me to do it? Please advice. thanks a lot.
Regards
Malcum
Cacti 0.8.6 HowTo » Advanced Magic : http://docs.cacti.net/node/224
--
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
I've got some scripts from my system admin. but i was told that cacti must be able to establish some sort of connection to the server to run the scripts. but i'm i cant seems to find any instructions on how to telnet or ssh to the system to run the scripts. Could someone please advice me on this part? Thanks a lot.
The script will need to reside on the box that Cacti runs on. Put the script in the script folder. You then create your data input method as outlined in http://docs.cacti.net/node/296 and then create your data source and get the data source to call the data input method you created.
Jay
Jay
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75
SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75
SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Please see http://forums.cacti.net/viewtopic.php?t=24960 for some hints
Reinhard
Reinhard
sorry but there is still one part i dont understand. as mention by jay just that the script needs to reside on cacti server under the scripts folder. but what i'm confuse is that how does cacti actually pull data from the server using the scripts? I've been question on this part by the system admin and i'm unable to answer them. i showed them how i add the host and the template but still we dont understand how the whole polling of data using scripts work. Could someone please advice me on this part? Thanks a lot in advance.
Hi
Take a look at the following
Data input methond and scripts documentation
http://docs.cacti.net/node/25
http://docs.cacti.net/node/26
Php script server documentation
http://docs.cacti.net/node/38
user submitted document on how to use scripts to log data
http://docs.cacti.net/node/521
If none of these help you then someone else will have to answer your question.
Jay
Take a look at the following
Data input methond and scripts documentation
http://docs.cacti.net/node/25
http://docs.cacti.net/node/26
Php script server documentation
http://docs.cacti.net/node/38
user submitted document on how to use scripts to log data
http://docs.cacti.net/node/521
If none of these help you then someone else will have to answer your question.
Jay
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75
SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75
SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
Be sure to skim the links the others posted as there's a ton of info on various ways to do this. Basically, you can have a script on the cacti server that connects to some service port on the remote machine to get the data. For instance, you might have inetd configured to listen on a specific port and just run a non-interactive script that dumps the results, then a perl script on the cacti server can connect to that port on the remote machine, gather the result and parse the output. Not terribly secure and not the way I'd do it, but it'd work.trfunite wrote:sorry but there is still one part i dont understand. as mention by jay just that the script needs to reside on cacti server under the scripts folder. but what i'm confuse is that how does cacti actually pull data from the server using the scripts?
You could have ssh configured so the cacti user had an ssh key and was allowed to remotely run the script via ssh (with no password to log in -- using the ssh certificate to authenticate) and thus you could make a script which resides on the cacti server that uses ssh to run some other script on the remote server and parse the output into a form cacti likes. Again, not the way i'd probably do it, but...
You could have net-snmp running on the remote machine and glue in the script that gets the data you want into net-snmp using the exec or pass commands in the snmpd.conf file. For instance, to gather postfix stats, I have a few scripts that run on the postfix server. net-snmp on the postfix relays is configured with these lines:
pass .1.3.6.1.4.1.2021.254 /usr/local/bin/countqueue.pl .1.3.6.1.4.1.2021.254
pass .1.3.6.1.4.1.2021.253 /usr/local/bin/queueage.pl .1.3.6.1.4.1.2021.253
So now cacti can send a variety of queries to 1.3.6.4.1.2021.254.something and net-snmp will pass these queries to the right perl script. These scripts look at the remainder of the OID being queried (the part beyond the .253 or .254) to figure out what I'm querying (ie, countqueue.pl gives the number of messages in a queue and the extra number in the OID determines which queue is being queried for). Then I just need to make cacti templates (using a normal snmp query and the appropriate OID) to gather all the ddifferent sorts of data and graph 'em. Tidy. This is how I usually glue odd stuff into cacti.
But like I said, go skim those other URLs too. There's loads of examples of different ways to hook interesting things into cacti.
Who is online
Users browsing this forum: No registered users and 1 guest