Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Anyone with issues in Zabbix 2.2? #20

Closed
vicendominguez opened this issue May 6, 2015 · 14 comments
Closed

Anyone with issues in Zabbix 2.2? #20

vicendominguez opened this issue May 6, 2015 · 14 comments
Assignees
Labels

Comments

@vicendominguez
Copy link

Hey guys! and Andrew! Thanks for your work.

I was checking zabbixweb and I can see info for two host and after it breaks.

With the inspector:

Uncaught TypeError: Cannot read property 'status' of undefined(index):265 (anonymous function)jquery.min.js:2 m.extend.each(index):214 (anonymous function)jquery.min.js:2 m.extend.each(index):201 filterHostsAndOutput(index):164 (anonymous function)jquery.min.js:2 m.Callbacks.jjquery.min.js:2 m.Callbacks.k.fireWithjquery.min.js:2 m.extend.readyjquery.min.js:2 J

index.html affected line:

if(webtrigger[0].status == 0 && webtrigger[0].value == 1) {
thisHostObj.error = 1;
thisHostObj.errorText = 'Web service is down (httpd or IIS)';

I have a lot of servers but i see only two servers in the zabbixweb and there is not complete info.

Looking at the last json request i see:

Request:

auth: "c11d9359fd1fdd2935c0248336bf4381"
id: 3
jsonrpc: "2.0"
method: "trigger.get"
params: {host: "cos.xxxxx.net", itemids: "24177"}
host: "cos.xxxxx.net"
itemids: "24177"

Answer:

{"jsonrpc":"2.0","result":[],"id":3}

It seems a empty answer... but i don't understand why. No info in the zabbix_server log file.

UPDATE: mmm... may be this is not the last request after all.... mmm... i am lost.

Vicen

@eburgueno
Copy link
Collaborator

Hi @vicendominguez, does the user you configured have access permissions on zabbix to see the servers you want to show? You can test it by login in on the Zabbix web frontend as that user.
Also, have you set the groupids to anything by any chance?

@eburgueno eburgueno self-assigned this May 6, 2015
@vicendominguez
Copy link
Author

Hey Eric thanks for answering Sir....

In my Overview View from the Monitoring tag using that user I can see all the values. No problems here.
On your second question, i didn't touch anything from master.zip I downloaded (from github) today (except user/pass and url).

My zabbix version is 2.2.9.

It is very odd. I don't have any idea. If it helps you, ask me more questions please.

@aletson
Copy link
Owner

aletson commented May 6, 2015

sounds like the call right above that - our separate Zabbix call for status of http server - is returning null. Could be a missing setting in the Zabbix installation - does 2.2 support that trigger.get call we're making or does that have to be set up explicitly?

Possible fix -

if (!webtrigger) {
          thisHostObj.error = 1;
          thisHostObj.errorText = 'Web service is unmonitorable, check Zabbix settings';
} else if(webtrigger[0].status == 0 && webtrigger[0].value == 1) {
          thisHostObj.error = 1;
          thisHostObj.errorText = 'Web service is down (httpd or IIS)';
}

See if this stops the page from throwing JavaScript errors, anyway...

Could be worth testing. Feel free to try it in your installation.

@aletson
Copy link
Owner

aletson commented May 6, 2015

(would replace lines 265-268 in the index.html file)

It's kind of a workaround though, I'll try and get a Zabbix 2.2 server spun up sometime next week to test on (out of town this weekend).

@vicendominguez
Copy link
Author

Andrew... may be... but I have tried your patch and I dont see any difference. Same error.

Uncaught TypeError: Cannot read property 'status' of undefined(anonymous function) @ (index):268m.extend.each @ jquery.min.js:2(anonymous function) @ (index):214m.extend.each @ jquery.min.js:2filterHostsAndOutput @ (index):201(anonymous function) @ (index):154m.event.dispatch @ jquery.min.js:3m.event.add.r.handle @ jquery.min.js:3

if I play with the checkbox from settings this errror is repeated when i change something.

But I don't see the message "Web service is unmonitorable, check Zabbix settings" when i run the page...

@aletson
Copy link
Owner

aletson commented May 6, 2015

Well, it was worth a shot.

The error shouldn't come up if you use https://github.com/velinath/zabbixweb/releases/tag/v0.1-release, but it looks like that commit doesn't include functionality for apache or iis monitoring.

Will do my best to look further next week.

@vicendominguez
Copy link
Author

Indeed Andrew, I don't have any error with the v0.1. So my question would be solved. 👍

But, on this release:

  • Memory and network values are wrong.
  • Hard disks list is empty in some hosts.

Anyway thank you for your interest and replies.

@eburgueno
Copy link
Collaborator

@vicendominguez After reading your original post in more detail, I think I know why you are getting only two servers. Sorry, I first replied in a rush.

The dashboard is built essentially by two nested for each loops: the first one iterates the servers, and the second one iterates on the items returned for each server. If an error occurs while iterating for the items of a server, execution stops and the following servers in the first loop are not processed (this is a bug, mainly because we didn't do any exception handling yet).

For some reason, the third server in the list returned by Zabbix is not coming back with any items. Why is this happening I can't tell as it would depend on your Zabbix setup.

Maybe you can help us with the debugging. Can you set up a breakpoint in line 202 in your browser console, do a "step into" until line 204, and then analyse the values returned for thisHostObj.items?

If you compare the first and second host (that are working), with the third one (that is failing), maybe it would give you a hint of why the code breaks. It could be that the items for that host in particular are not the ones we expect.

@vicendominguez
Copy link
Author

Ok.. line 202-205 seems ok in the three hosts i can see.

But...my firsts two hosts do not satisfy this case. The third it does.

                case 'net.tcp.service[http]':
                    //Shame we need a second API call, but using 'selectTriggers' in the host.get method doesn't return anything we can use to check the status of the trigger
                    //See https://www.zabbix.com/forum/showthread.php?t=24137
                    var webtrigger = zabbix.call('trigger.get', {
                        "host": thisHostObj.name,
                        "itemids": $(this)[0].itemid,
                        });
                    if(webtrigger[0].status == 0 && webtrigger[0].value == 1) {
                        thisHostObj.error = 1;
                        thisHostObj.errorText = 'Web service is down (httpd or IIS)';
                    }

i think webtrigger is a array of objects here but after the "trigger.get" call, it has length=0 and if i try to print something in that breakpoint (i put two of them: lines 261 and 265) i got:

console.log(webtrigger);
[]
undefined
console.log(webtrigger[0]);
undefined
undefined

So sorry, perhaps this is not the best info but i am sysadmin and i am a little lost here.

@aletson
Copy link
Owner

aletson commented May 7, 2015

Can you check to see if there is a trigger configured on the relevant host that you're having trouble with, as well? If you go into the host and look at its triggers, the one that I'm specifically wondering about is anything from the "App HTTP Service" template, or any with an expression that looks like "{servername:net.tcp.service[http].max(#3)}=0".

I don't think the absence of the trigger in Zabbix would affect it, but just to get the additional information might help us get to a solution faster.

I just spun up a Zabbix 2.2 instance with my production servers and was able to duplicate this issue, FWIW.

While that info's coming in, I'm working on a code-based solution as well.

edit: It looks like this is actually related to #8 to some extent - one of the cases described there may be applicable. Implementing the old code works, but if we went that route we'd break other things. If necessary we can add an explicit version check in this case and use the old method for <2.4, but I'd prefer not to do that if at all possible.

@aletson
Copy link
Owner

aletson commented May 7, 2015

think I have solution, changed the conditional as follows:

if(webtrigger[0] && webtrigger[0].status == 0 && webtrigger[0].value == 1) {

@eburgueno do you see any harm in this one? if not I can commit it

@eburgueno
Copy link
Collaborator

@velinath I don't see any issues with it. Good catch.

@vicendominguez
Copy link
Author

Sorry for the delay, it is late here.

I can confirm the "if" solves the issue. Thx guys!

PS: But, so sorry, i have to open other ticket for the bad info on used ram memory value.
Max memory and used memory have the same value and that is not true.

@eburgueno
Copy link
Collaborator

Cool, thanks for confirming @vicendominguez.

Memory is a tricky one, as different versions of Linux have different metrics, and in turn Windows servers are also different. "Used memory" means something different depending on the OS. But yes, open a new issue and we can have a look.

aletson pushed a commit that referenced this issue May 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants