I am trying to create a graph from the direct output of a perl script. It logs in to a network device and pulls info via Net::Telnet, and has 3 variables it returns, 1 i would like to be informational and not graph just represent as it is the port number and won't change. The three variables are
Port: TxPower: RxPower
the script returns output from the result of running spine manually
/usr/local/spine/bin/spine --verbosity=5 9 9
10/15/2015 02:49:38 PM - SPINE: Poller[0] Host[9] TH[1] DS[77] SCRIPT: /usr/bin/perl /usr/share/cacti/site/scripts/Show_Optic.pl 10.0.2.2 tanner gotcha 7, output: Port:7 RxPower:214.3647 TxPower:002.9242
and adds information to the poller_output table in mysql
i am using spine/ubuntu/cacti version 0.8.7i
but the debug of the cacti.log says it returns a output: U from the result of the script and i am at a loss on how to trouble shoot this any further. Wondering if this is possible, i think it should be. Any help would be appreciated
Cacti Perl Script Direct Output
Moderators: Developers, Moderators
-
- Posts: 1
- Joined: Thu Oct 15, 2015 1:22 pm
Cacti Perl Script Direct Output
- Attachments
-
- Data template
- datatemplate.png (131.04 KiB) Viewed 798 times
-
- data input method
- DataInputMethod.png (99.61 KiB) Viewed 798 times
-
- cacti poller debug output log.txt
- here is a log of the poller debug
- (23.75 KiB) Downloaded 115 times
-
- Posts: 33
- Joined: Sun Mar 25, 2012 12:22 pm
Re: Cacti Perl Script Direct Output
I don't believe it's possible to reference Data Input Method values in a graph (but it would be awesome if we could).wannabeRootGod wrote:I am trying to create a graph from the direct output of a perl script. It logs in to a network device and pulls info via Net::Telnet, and has 3 variables it returns, 1 i would like to be informational and not graph just represent as it is the port number and won't change. The three variables are
Even if you were to use a script query, it would be a massive rewrite of your script to properly handle indexing the data. If you were to do that, you could use |query| variables to reference data in the SNMP Cache.
If your script works by hand, from both CLI and from CLI through spine then it should be just fine.wannabeRootGod wrote: Port: TxPower: RxPower
the script returns output from the result of running spine manually
/usr/local/spine/bin/spine --verbosity=5 9 9
10/15/2015 02:49:38 PM - SPINE: Poller[0] Host[9] TH[1] DS[77] SCRIPT: /usr/bin/perl /usr/share/cacti/site/scripts/Show_Optic.pl 10.0.2.2 tanner gotcha 7, output: Port:7 RxPower:214.3647 TxPower:002.9242
and adds information to the poller_output table in mysql
i am using spine/ubuntu/cacti version 0.8.7i
but the debug of the cacti.log says it returns a output: U from the result of the script and i am at a loss on how to trouble shoot this any further. Wondering if this is possible, i think it should be. Any help would be appreciated
Is anything timing out or taking a long time to respond, which might result in a U return value?
silvertip257
Re: Cacti Perl Script Direct Output
Either the SNMP or Script Data queries can be used for displaying static data in graphs http://docs.cacti.net/manual:088:3a_adv ... alkthroughsilvertip257 wrote:I don't believe it's possible to reference Data Input Method values in a graph (but it would be awesome if we could).wannabeRootGod wrote:I am trying to create a graph from the direct output of a perl script. It logs in to a network device and pulls info via Net::Telnet, and has 3 variables it returns, 1 i would like to be informational and not graph just represent as it is the port number and won't change. The three variables are
Even if you were to use a script query, it would be a massive rewrite of your script to properly handle indexing the data. If you were to do that, you could use |query| variables to reference data in the SNMP Cache.
1) Cacti 0.8.8f is the latest which has a ton of features/bugs/security fixes. should strongly consider about upgrading.wannabeRootGod wrote: Port: TxPower: RxPower
the script returns output from the result of running spine manually
/usr/local/spine/bin/spine --verbosity=5 9 9
10/15/2015 02:49:38 PM - SPINE: Poller[0] Host[9] TH[1] DS[77] SCRIPT: /usr/bin/perl /usr/share/cacti/site/scripts/Show_Optic.pl 10.0.2.2 tanner gotcha 7, output: Port:7 RxPower:214.3647 TxPower:002.9242
2) Increase the poller logging level to high or debug for a single cycle. Look in the log around when the Show_Optic.pl runs for any other info.
3) Temporarily switch to cmd.php poller to check if that properly parses the Show_Optic.pl output. Offhand looks like its correctly formatted.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
-
- Posts: 33
- Joined: Sun Mar 25, 2012 12:22 pm
Re: Cacti Perl Script Direct Output
My statement was a bit vague.BSOD2600 wrote:Either the SNMP or Script Data queries can be used for displaying static data in graphs http://docs.cacti.net/manual:088:3a_adv ... alkthroughsilvertip257 wrote:I don't believe it's possible to reference Data Input Method values in a graph (but it would be awesome if we could).wannabeRootGod wrote:I am trying to create a graph from the direct output of a perl script. It logs in to a network device and pulls info via Net::Telnet, and has 3 variables it returns, 1 i would like to be informational and not graph just represent as it is the port number and won't change. The three variables are
Even if you were to use a script query, it would be a massive rewrite of your script to properly handle indexing the data. If you were to do that, you could use |query| variables to reference data in the SNMP Cache.
...trimmed...
BSOD2600 is right, one can use SNMP Data Query or Script Queries to retrieve data.
What I meant to say was that [I don't believe there is] direct access to Data Input Method parameters without creating an RRA.
If it is possible that would give wannabeRootGod the ability to reference the port parameter in his graph (without having to re-gather data that was already used as a parameter).
Script Query is the way.
Retrieving static values from the SNMP Cache is possible once a Data Query is created (does not create an RRA file). Make sure to set the Data Query field as an input field (via |query| variables - see Data Query Fields section). If you intend to create a Data Template (and store values in RRAs) as well, you need two fields (one for each direction type of input/output).
silvertip257
Who is online
Users browsing this forum: No registered users and 3 guests