hey guys, im not asking you to explain the whole thing
but rather point me in the right direction(you can explain if you want though :])
i have a script on Server1(SNMP Hosts) and Server2(Cacti server)
i need to have the output of a script(a number) send to the cacti server
for example
(On Server1, NOT CACTI)
#!/bin/bash
if [ `whoami` = "root" ]
then
echo "1"
else
echo "0"
fi
and i want to send this output to Cacti
for it to be graphed, to show on my tests if the user is root
or is not root
this of course is not a situation, but rather an example
on how to pass numbers to cacti from SNMP hosts
thank you for your time
`KruZ~
ABSOLUTLY ANY HELP
would be greatly appreciated
*Output From Scripts through SNMP?*
Moderators: Developers, Moderators
If you are dealing with another Linux/*nix box, I would use an OID. The net-snmp daemon can call just about any script you want.
Take a look at how it is done for postfix mailgraph - http://forums.cacti.net/viewtopic.php?t=6657
Then modify that to do what you want.
Take a look at how it is done for postfix mailgraph - http://forums.cacti.net/viewtopic.php?t=6657
Then modify that to do what you want.
--
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
thank you very much
i am starting a fairly complex project
to get output of different commands(all numerical)
and having cacti graph them
from one linux box(server 1, server i want the script to run on) results to server2 (the cacti server)
thank you very much i will look into it
thank you again, i will post my results, and or scripts
any more input anyone?
i am starting a fairly complex project
to get output of different commands(all numerical)
and having cacti graph them
from one linux box(server 1, server i want the script to run on) results to server2 (the cacti server)
thank you very much i will look into it
thank you again, i will post my results, and or scripts
any more input anyone?
Hi.
Check cacti scripts: <path_cacti>/scripts/*.
For example diskfree.sh
Check cacti scripts: <path_cacti>/scripts/*.
For example diskfree.sh
Code: Select all
#!/bin/sh
df -k $1 | grep -v Filesystem| awk '{printf "megabytes:" $4 " percent:" int($5)}'
I've done the same thing as Linegod with my MailScanner and Sendmail graphs (http://forums.cacti.net/viewtopic.php?t=15651).
I have a script running on my mail server to count a variety of things. Then when I query an SNMP OID I choose then Net-SNMP runs another script to read those counters into my Cacti server.
Check out your snmpd.conf file and look for a section about Executables/scripts. Or check the Net-SNMP documentation section for the snmpd.conf file (http://net-snmp.sourceforge.net/docs/ma ... .conf.html) and look for the "Arbitrary Extension Commands" section. It should point you in the direction I think you're looking for.
I have a script running on my mail server to count a variety of things. Then when I query an SNMP OID I choose then Net-SNMP runs another script to read those counters into my Cacti server.
Check out your snmpd.conf file and look for a section about Executables/scripts. Or check the Net-SNMP documentation section for the snmpd.conf file (http://net-snmp.sourceforge.net/docs/ma ... .conf.html) and look for the "Arbitrary Extension Commands" section. It should point you in the direction I think you're looking for.
Who is online
Users browsing this forum: No registered users and 1 guest