Newbie OID issue

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

Moderators: Developers, Moderators

randomt
Posts: 9
Joined: Tue May 09, 2006 8:08 pm

Post by randomt »

well well.. if i create the graphs by hitting the link on top of the device page, all i says is it created the graphs.. if i create one via the graph management page however, i get a nice error:

Code: Select all

RRDTool Says:

ERROR: Not a valid vname: #4668E4 in line AREA:#4668E4:Temperature (Celcius)
quaint.
randomt
Posts: 9
Joined: Tue May 09, 2006 8:08 pm

Post by randomt »

Some odd program flow there.. but thats a different issue.. really I need to figure out just where exactly the rrd database is generated (and why its not in this case)


/cacti/resource/script_queries/omnitronix_sl81.xml

Code: Select all

<interface>
        <name>Get Omnitronix SL81 statistics</name>
        <script_path>/usr/bin/perl  |path_cacti|/scripts/omnitronix_sl81.pl</script_path>
        <arg_prepend>|host_hostname| |host_snmp_community| </arg_prepend>
        <arg_index>index</arg_index>
        <arg_query>query</arg_query>
        <arg_get>get</arg_get>
        <arg_num_indexes>num_indexes</arg_num_indexes>
        <output_delimeter>:</output_delimeter>
        <index_order>omniID</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>

        <fields>
                <omniID>
                        <name>Temperature sensor Index Number</name>
                        <direction>input</direction>
                        <query_name>omniID</query_name>
                </omniID>

                <omniSensor>
                        <name>Omnitronix sensor device name</name>
                        <direction>input</direction>
                        <query_name>omniSensor</query_name>
                </omniSensor>

                <omniTemp>
                        <name>Omnitronix Temperature</name>
                        <direction>output</direction>
                        <query_name>omniTemp</query_name>
                </omniTemp>
        </fields>
</interface>

/cacti/scripts/omnitronix_sl81.pl

Code: Select all

#!/usr/bin/perl
use SNMP_util;

#print "0: $ARGV[0] 1: $ARGV[1] 2: $ARGV[2] 3: $ARGV[3] 4: $ARGV[4] \n";

if (($ARGV[2] ne "query") && ($ARGV[2] ne "get") && ($ARGV[2] ne "index")) { 
    print "usage:\n\n  ./omnitronix_sl81.pl host community index \
                       \n./omnitronix_sl81.pl host community query {omniSensor, omniID, omniTemp} \
                       \n./omnitronix_sl81.pl host community get {omniSensor, omniID, omniTemp} DEVICE\n"; \
        exit;
}

my $host = $ARGV[0];
my $community = $ARGV[1];

my ($connectfield)  = $community . "\@" . $host;

my ($indexnum) = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.2.1.1");
my ($oid) = "";


if($ARGV[2] eq "index") {
  @id = &snmpwalk($connectfield, "1.3.6.1.4.1.3052.5.2.1.2.1.1");
  foreach(@id) { my ($index, $val) = split(/:/); print $val."\n";}  
}
if($ARGV[2] eq "query") {
  @id = &snmpwalk($connectfield, "1.3.6.1.4.1.3052.5.2.1.2.1.1");
  foreach (@id) {
     my ($idx, $val) = split(/:/);
     if($ARGV[3] eq "omniSensor") {
        $name = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.1.1.1.1.4.$val.1.1");
        print "$val:$name\n";
     }
     elsif($ARGV[3] eq "omniID") {
        print "$val:$val\n";
     }
     elsif($ARGV[3] eq "omniTemp") {
        $value = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.1.1.1.1.6.$val.1.1");
        print "$val:$value\n";

     }
     else {
       print $val.":\n";
     }
  }
}
elsif($ARGV[2] eq "get") {
     $idx = $ARGV[4];
     if($ARGV[3] eq "omniSensor") {
        $name = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.1.1.1.1.4.$idx.1.1");
        print "$name";
     }
     elsif($ARGV[3] eq "omniID") {
        print "$idx";
     }
     elsif($ARGV[3] eq "omniTemp") {
        $value = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.1.1.1.1.6.$idx.1.1");
        print "$value";

     }
     else {
     }
}
randomt
Posts: 9
Joined: Tue May 09, 2006 8:08 pm

Post by randomt »

Success! Turns out I didnt have the data source checked off on the data-query's assoc. Fun times.

Thanks for attempting to help gentlemen.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

You surely checked the /rra permissions for the user running the poller from crontab? Then, please su to that user and run the poller manually to check for error messages. The poller always should check if the rrd is present and create it, if not.
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests