PDA

View Full Version : UserParameter Always showing "Not Supported"


rushowr
14-08-2005, 16:54
I've got an interesting one for you mates again....

I'm running zabbix on an asterisk system using userparameters to call asterisk with the -rx (connect, run command, show output, exit) option. my command line is this:

sudo -H /usr/sbin/asterisk -rx 'show queues' | grep --text -i '901' | awk '{print $3}'

so in the configuration file it looks like this:

UserParameter=queuelevel[901], sudo -H /usr/sbin/asterisk -rx 'show queues' | grep --text -i '901' | awk '{print $3}'

now, when I login AS zabbix user, it returns the number of calls holding in the queue (0 curently for example). It returns ONLY the number.

Here's the kicker. Zabbix changes the status of this item to "Not Supported" after every check. I have no idea why, and need help as I've got some serious breathing down my neck going on over it.

Permissions are correct, as I can run it as the zabbix user with no problem.

Any ideas on this?

James Wells
15-08-2005, 03:54
Greetings,

From what I have seen, this happens if your UserParameter check returns more than a single line of data. Additionally, looking at your command, I think part of the problem may be that zabbix_agentd doesn't know where sudo is.

First thing I would recommend trying is adding the full path to sudo to the UserParameter command. If it still fails, double check that your command is returning only a single line of data.

Hope this helps

rushowr
15-08-2005, 13:55
Hey thanks for the idea. I know it's returning only one line of data, and other UserParameters are using sudo (all of mine do for asterisk monitoring since it's a root only program) and they do not give this error. I'll try the fix, just in case. I'll keep ya posted.

Thanks again,
Sherwood

rushowr
20-08-2005, 22:48
This is definitely not the problem. The script passes data correctly (only one line), and the permissions are correct, and it's only numeric, and explicitly stating sudo is not workig either...

anyone have any other ideas?

Alexei
20-08-2005, 23:56
Does it have trailing EOL?

rushowr
21-08-2005, 02:18
As far as I can tell no. GREP only puts out the line that matches the request. I'll try seeing about using sed to strip EOL's if they exist.

Let me know if this is the right thinking. If I run the script myself and see something like this:

zabbix@someserver#> ./script
515
zabbix@someserver#>

I should be looking at an output that returns no trailing EOL, because otherwise it would look like this:

zabbix@someserver#> ./script
515

zabbix@someserver#>

sound right?

rushowr
22-08-2005, 20:47
I definitely have no trailing EOL....

Any other ideas? This is rather strange...the script outputs just a digit, that's it, just like is needed for UserParameters.

Is there a bug with returning a 0?

Need answers, tearing my hair out over this.

rajeevtomar
23-08-2005, 11:12
I would suggest you to write the output of the command in some file then in conf file do a cat on that file.

this wil help you to debug the problem for sure.

Please let me know if it helps.

Zabbix is cool in monitoring the things.

Regards,
Rajeev Tomar

rushowr
30-08-2005, 15:06
Thanks for the answer, I'll try that.

Cheers

xaeth
30-08-2005, 16:39
i'm having the same issue w/ my qmail monitoring now... it used to run fine, but now it rarely lasts more than a few hours.

I monitor 3 files. The script runs the initial query and outputs it to a file, then basically does "grep subject file > newfile". The zabbix agent does a cat of newfile. All 3 agents done in this matter die at basically the same time.


There doesnt appear to be any trailing eol. and the output doesnt really change from run to run from what i can see.

tobiasbp
06-04-2006, 12:37
This may have been fixed ages ago, but I just had the same problem. I solved the problem by changing:
awk '{print $3}'

to:
awk '{print $ 3}'

pattieja
06-04-2006, 18:48
If you run zabbix_agentd -p, what do you see for your returned value? I've been only getting [s|<numeric value>] returns for my UserParameter entries (ZABBIX 1.1beta8).

just2blue4u
07-04-2006, 14:27
This may have been fixed ages ago, but I just had the same problem. I solved the problem by changing:
awk '{print $3}'

to:
awk '{print $ 3}'


I had the same problem.
Thanks to your solution (print $ 3) it works quite good now!
Thank you!