ZABBIX Forums  

Go Back   ZABBIX Forums > Zabbix Discussions and Feedback > Zabbix Troubleshooting and Problems

Reply
 
Thread Tools Display Modes
  #11  
Old 01-06-2007, 00:19
treyh treyh is offline
Member
 
Join Date: May 2007
Posts: 64
Default mib

Hello,

I loaded a cisco mib for 1.3.6.1.4.1.9.9.109.1.1.1.1.8

It works with snmpwalk:
zabbix# snmpwalk -v 2c -c communityname 192.168.0.1 1.3.6.1.4.1.9.9.109.1.1.1.1.8
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.1 = Gauge32: 2

Zabbix gives this error:
000700:20070531:171510 OID [1.3.6.1.4.1.9.9.109.1.1.1.1.8] value #2 has unknow type [81]
*yes that is a typo on zabbix's part "unknow" instead of "unknown"

I restarted net-snmp, zabbix server and agent, and then finally rebooted but that didnt' work.

My next guess would be to recompile zabbix and reinstall, am I correct?
Reply With Quote
  #12  
Old 01-06-2007, 04:52
rraver rraver is offline
Junior Member
 
Join Date: May 2007
Posts: 25
Default

do you have other SNMP pulls working? I would think that there would be something wrong with item where it defines the type. I am uncertain about this though. Let me know what configuration you have for that item and how anything else goes.
Reply With Quote
  #13  
Old 01-06-2007, 13:40
Alexei Alexei is offline
Zabbix developer, product manager
 
Join Date: Sep 2004
Location: Riga, Latvia
Posts: 5,621
Lightbulb

Are you sure you use same version of SNMP in ZABBIX? v2c?
__________________
Alexei Vladishev
Creator of Zabbix, Product manager
New York | Tokyo | Riga
My Twitter
Reply With Quote
  #14  
Old 01-06-2007, 15:05
treyh treyh is offline
Member
 
Join Date: May 2007
Posts: 64
Default net-snmp

Here are more details about my setup.

Freebsd 6.2
php 5.1.1 (installed from source)
Apache/2.0.59 (installed from source)
mysql-5.0.41 (installed from source)
net-snmp 5.3.1 (installed from ports)
zabbix 1.4 (installed from source)

Here is my configure command:

./configure --enable-server --enable-agent --with-mysql=/var/apps/mysql --with-net-snmp

When I configured should I have specified the location for net-snmp?

The router is running v2, and so is my server, and thats what I chose in zabbix.
Reply With Quote
  #15  
Old 01-06-2007, 18:48
treyh treyh is offline
Member
 
Join Date: May 2007
Posts: 64
Default actions

Hello,

My actions are also not working.

The trigger is working because it shows up in Events but the action isn't showing up or emailing me.

Action Type: Send message
Source: Trigger
Conditions: Host group = "freebsd_server"
Send Message: Single User
User: trey
Repeat: No
Status: Enabled

If if the mail config is wrong there should still be an action showing up correct?
Reply With Quote
  #16  
Old 24-07-2007, 23:55
mcarbonneaux mcarbonneaux is offline
Junior Member
 
Join Date: Jul 2007
Posts: 27
Default

i have the same problem...

and i think is the type of the oid where are the probleme :"Gauge32"

because on the same equipement other oid with other type work fine...
onlye gauge32 dont work (but work with snmpwalk shell cmd).

and i use the same snmp version in zabbix and snmpwalk cmd...

i used net-snmp 5.4 and zabbix 1.4.1...

that where strange, is the returned type (81 in hex):

Quote:
# find /product/net-snmp/include/ -type f | xargs grep 81
/product/net-snmp/include/net-snmp/library/snmp.h:#define SNMP_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x1) /* 81=129 */
Quote:
# find /product/net-snmp/include/ -type f | xargs grep 129
/product/net-snmp/include/net-snmp/library/snmp.h:#define SNMP_VERSION_2p 129 /* no longer supported by this code (> 4.0) */
/product/net-snmp/include/net-snmp/library/snmp.h:#define SNMP_MSG_INTERNAL_OBJECT_LOOKUP 129
/product/net-snmp/include/net-snmp/library/snmp.h:#define SNMP_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x1) /* 81=129 */
but i don't know why they respond this code in type field !!!!

the debug trace of the snmp get:
Quote:
13210:20070725:000608 In get_value()
13210:20070725:000608 In get_value_SNMP()
13210:20070725:000608 SNMP [xxxxx@x.x.x.x:161:161]
13210:20070725:000608 OID [.1.3.6.1.4.1.1872.2.5.4.2.5.2]
13210:20070725:000608 In get_value_SNMP() 0.2
13210:20070725:000608 In get_value_SNMP() 0.3
13210:20070725:000608 Status send [0]
13210:20070725:000608 In get_value_SNMP() 0.4
13210:20070725:000608 In get_value_SNMP() 1
13210:20070725:000608 In get_value_SNMP() 2
13210:20070725:000608 AV loop()
13210:20070725:000608 OID [.1.3.6.1.4.1.1872.2.5.4.2.5.2] value #2 has unknow type [81]
13210:20070725:000608 End get_value()

Last edited by mcarbonneaux; 25-07-2007 at 00:28.
Reply With Quote
  #17  
Old 25-07-2007, 00:19
mcarbonneaux mcarbonneaux is offline
Junior Member
 
Join Date: Jul 2007
Posts: 27
Default

i think the probleme is near:
13209:20070725:000609 SNMP [xxxx@x.x.x.x:161:161]

in "src/zabbix_server/poller/checks_snmp.c"
Quote:
zabbix_log( LOG_LEVEL_DEBUG, "SNMP [%s@%s:%d]",
session.community,
session.peername,
session.remote_port);
only one ":" are in log format string...
only possibility are the "session.remote_port" variable contain "161:161" or session.peername "x.x.x.x:161" !!!

after verifying, is session.peername that containe the port...
Quote:
if(item->useip == 1)
{
#ifdef NEW_APPROACH
zbx_snprintf(temp,sizeof(temp),"%s:%d",
item->host_ip,
item->snmp_port);
session.peername = temp;
session.remote_port = item->snmp_port;
#else
session.peername = item->host_ip;
session.remote_port = item->snmp_port;
#endif
}
else
{
#ifdef NEW_APPROACH
zbx_snprintf(temp, sizeof(temp), "%s:%d",
item->host_dns,
item->snmp_port);
session.peername = temp;
session.remote_port = item->snmp_port;
#else
session.peername = item->host_dns;
session.remote_port = item->snmp_port;
#endif
}
because of the new approche...

i'm not sure is ok!!! i don't masterize net-snmp lib!

but i'm not sure to have the port in peername and remote_port at same time are ok....

Last edited by mcarbonneaux; 25-07-2007 at 00:30.
Reply With Quote
  #18  
Old 25-07-2007, 01:49
mcarbonneaux mcarbonneaux is offline
Junior Member
 
Join Date: Jul 2007
Posts: 27
Default

i've found where is the probleme...

when i make a snmpwalk on .1.3.6.1.4.1.1872.2.5.4.2.5.2 return:
.1.3.6.1.4.1.1872.2.5.4.2.5.2.0 = Gauge32: 1318
but when snmpget on the same OID return:
.1.3.6.1.4.1.1872.2.5.4.2.5.2 = No Such Instance currently exists at this OID

in fact the walk, walk throug the hierachy...
the correct oid are: .1.3.6.1.4.1.1872.2.5.4.2.5.2.0
and work fine...


to ameliorate the error logging for this type of probleme i suggest to add similar peace of code like that (extract from print_variable net-snmp code "snmplib/mib.c")

Quote:
if (variable->type == SNMP_NOSUCHOBJECT) {
return snmp_strcat(buf, buf_len, out_len, allow_realloc,
(const u_char *)
"No Such Object available on this agent at this OID");
} else if (variable->type == SNMP_NOSUCHINSTANCE) {
return snmp_strcat(buf, buf_len, out_len, allow_realloc,
(const u_char *)
"No Such Instance currently exists at this OID");
} else if (variable->type == SNMP_ENDOFMIBVIEW) {
return snmp_strcat(buf, buf_len, out_len, allow_realloc,
(const u_char *)
"No more variables left in this MIB View (It is past the end of the MIB tree)");
in place of sending unknown type ...

seem to be more user friendly!
Reply With Quote
  #19  
Old 25-07-2007, 02:04
mcarbonneaux mcarbonneaux is offline
Junior Member
 
Join Date: Jul 2007
Posts: 27
Default

one little patch to correct this probleme plus two other i've found...


Code:
diff -u -r zabbix-1.4.1/src/zabbix_server/poller/checks_external.c zabbix-1.4.1-patched/src/zabbix_server/poller/checks_external.c
--- zabbix-1.4.1/src/zabbix_server/poller/checks_external.c     2007-06-29 22:50:26.000000000 +0200
+++ zabbix-1.4.1-patched/src/zabbix_server/poller/checks_external.c     2007-07-20 02:14:58.000000000 +0200
@@ -56,22 +56,22 @@
        init_result(result);

        strscpy(key, item->key);
-       if((p2=strstr(key,"(")) != NULL)
+       if((p2=strstr(key,"[")) != NULL)
        {
                *p2=0;
                strscpy(scriptname,key);
-               *p2='(';
+               *p2='[';
                p2++;
        }
        else    ret = NOTSUPPORTED;

        if(ret == SUCCEED)
        {
-               if((ret == SUCCEED) && (p=strstr(p2,")")) != NULL)
+               if((ret == SUCCEED) && (p=strstr(p2,"]")) != NULL)
                {
                        *p=0;
                        strscpy(params,p2);
-                       *p=')';
+                       *p=']';
                        p++;
                }
                else    ret = NOTSUPPORTED;
@@ -84,7 +84,10 @@
                return NOTSUPPORTED;
        }

-       zbx_snprintf(cmd, MAX_STRING_LEN-1, "%s/%s %s %s", CONFIG_EXTERNALSCRIPTS, scriptname, item->host_name, params);
+       if (item->useip==1)
+         zbx_snprintf(cmd, MAX_STRING_LEN-1, "%s/%s %s %s", CONFIG_EXTERNALSCRIPTS, scriptname, item->host_ip, params);
+       else
+         zbx_snprintf(cmd, MAX_STRING_LEN-1, "%s/%s %s %s", CONFIG_EXTERNALSCRIPTS, scriptname, item->host_dns, params);
        zabbix_log( LOG_LEVEL_DEBUG, cmd );
        if (NULL == (fp = popen(cmd, "r")))
        {
diff -u -r zabbix-1.4.1/src/zabbix_server/poller/checks_simple.c zabbix-1.4.1-patched/src/zabbix_server/poller/checks_simple.c
--- zabbix-1.4.1/src/zabbix_server/poller/checks_simple.c       2007-06-29 22:50:26.000000000 +0200
+++ zabbix-1.4.1-patched/src/zabbix_server/poller/checks_simple.c       2007-07-25 02:00:30.836587875 +0200
@@ -59,7 +59,7 @@
                        {
                                zbx_snprintf(c,sizeof(c),"net.tcp.service[%s,%s]",
                                        item->key,
-                                       item->host_ip);
+                                       item->host_dns);
                        }
                }
        }
diff -u -r zabbix-1.4.1/src/zabbix_server/poller/checks_snmp.c zabbix-1.4.1-patched/src/zabbix_server/poller/checks_snmp.c
--- zabbix-1.4.1/src/zabbix_server/poller/checks_snmp.c 2007-06-29 22:50:26.000000000 +0200
+++ zabbix-1.4.1-patched/src/zabbix_server/poller/checks_snmp.c 2007-07-25 01:57:09.883471108 +0200
@@ -113,7 +113,7 @@
        {
                session.community = (u_char *)item->snmp_community;
                session.community_len = strlen((void *)session.community);
-               zabbix_log( LOG_LEVEL_DEBUG, "SNMP [%s@%s:%d]",
+               zabbix_log( LOG_LEVEL_DEBUG, "SNMP [%s@'%s':%d]",
                        session.community,
                        session.peername,
                        session.remote_port);
@@ -195,7 +195,7 @@
                                return NOTSUPPORTED;
                        }
                }
-               zabbix_log( LOG_LEVEL_DEBUG, "SNMPv3 [%s@%s:%d]",
+               zabbix_log( LOG_LEVEL_DEBUG, "SNMPv3 [%s@'%s':%d]",
                        session.securityName,
                        session.peername,
                        session.remote_port);
@@ -264,6 +264,7 @@
                        int count=1;
                        zabbix_log( LOG_LEVEL_DEBUG, "AV loop()");

+
 /*                     if(     (vars->type == ASN_INTEGER) ||*/
                        if(     (vars->type == ASN_UINTEGER)||
                                (vars->type == ASN_COUNTER) ||
@@ -406,8 +407,53 @@
                                        }
                                }
                        }
+                       else if (vars->type == SNMP_NOSUCHOBJECT)
+                       {
+                               count++;
+
+                               zbx_snprintf(error,sizeof(error),"OID [%s] value #%d No Such Object available on this agent at this OID",
+                                       item->snmp_oid,
+                                       count);
+
+                               zabbix_log( LOG_LEVEL_ERR, "%s",
+                                       error);
+                               SET_MSG_RESULT(value, strdup(error));
+
+                               ret  = NOTSUPPORTED;
+
+                       }
+                       else if (vars->type == SNMP_NOSUCHINSTANCE)
+                       {
+                               count++;
+
+                               zbx_snprintf(error,sizeof(error),"OID [%s] value #%d No Such Instance currently exists at this OID",
+                                       item->snmp_oid,
+                                       count);
+
+                               zabbix_log( LOG_LEVEL_ERR, "%s",
+                                       error);
+                               SET_MSG_RESULT(value, strdup(error));
+
+                               ret  = NOTSUPPORTED;
+                       }
+                       else if (vars->type == SNMP_ENDOFMIBVIEW)
+                       {
+                               count++;
+
+                               zbx_snprintf(error,sizeof(error),"OID [%s] value #%d No more variables left in this MIB View (It is past the end of the MIB tree)",
+                                       item->snmp_oid,
+                                       count);
+
+                               zabbix_log( LOG_LEVEL_ERR, "%s",
+                                       error);
+                               SET_MSG_RESULT(value, strdup(error));
+
+                               ret  = NOTSUPPORTED;
+                       }
                        else
+
                        {
+
 /* count is not really used. Has to be removed */
                                count++;
Best Regards,
Mathieu
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:06.