Ad Widget

Collapse

Problem with MySQL and other custom UserParameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BryanR
    Junior Member
    • Oct 2005
    • 4

    #1

    Problem with MySQL and other custom UserParameters

    Hi,

    Im running zabbix-1.1beta1, and Im having a bit of trouble of UserParameters, that im hoping that someone might be able to help me out with. Some seem to work perfectly, and others report "Not supported by ZABBIX agent".

    First of all, I've modified a cookbook example to query a web host and calculate the number of seconds until the SSL certificate expires. The script is just a bit of bash code that calls openssl, and uses 'date' to return the number of seconds. It works wonderfully
    UserParameter=sslexpires[expiry],/usr/local/bin/zabbixCertificateLifespan www.mydomain.com
    So, I thought I would write a UserParameter to call 'ftpcount' to enumerate the those currently connected to my ProFTPd service. The command line seems to work okay from the command line (run as the zabbix user), but the Item is reported as "Not supported by ZABBIX agent". I originally thought it might be an exit code problem, but putting the command into a script with "exit 0" didn't help
    UserParameter=ftp[users],/usr/bin/ftpcount 2>/dev/null | tail -n 1 | sed 's/[^0-9]//g'
    [0.20 zabbix@rhino /]$ /usr/bin/ftpcount 2>/dev/null | tail -n 1 | sed 's/[^0-9]//g'
    8
    [0.19 zabbix@rhino /]$
    Likewise, I cant get the example MySQL UserParameters to work either - even though they work perfectly from the command line. I've changed the -u flag to a user who has suitable access, and have tested this from the command line. In the front-end, I get "Not supported by ZABBIX agent".
    UserParameter=mysql[ping],mysqladmin -u status ping | grep alive | wc -l
    [0.22 zabbix@rhino /]$ mysqladmin -u status ping | grep alive | wc -l
    1
    [0.22 zabbix@rhino /]$
    Anyone got any ideas?

    Cheers,
    Bryan
    Last edited by BryanR; 04-10-2005, 11:23.
  • elkor
    Senior Member
    • Jul 2005
    • 299

    #2
    Not sure. the suggestions below are just guesses

    for your ftp user script.. maybe it's getting hung up with the redirect or it's taking too long to execute? try putting that in cron to run every minute and dump the output to a datafile. then have the agent just do "cat datafile"

    the mysqladmin one is even odder.. as it's pretty straightforward.
    what shell does the zabbix user spawn to execute these commands? perhaps it's not a login shell and the environment isn't what you expect it to be?

    Comment

    • Nate Bell
      Senior Member
      • Feb 2005
      • 141

      #3
      Are you certain these commands are being run by the user zabbix? If you start the zabbix (server or agent, I can't remember which) with user admin, then zabbix runs it's UserParameters with user admin. I know I've run into some permission errors with this.

      Comment

      • BryanR
        Junior Member
        • Oct 2005
        • 4

        #4
        Problem with MySQL and other custom UserParameters [fixed]

        Hey,

        Thanks for your help. This morning, I removed the offending Items from my host and re-added them- and it seemed to fix the problem. Not sure whether this is a bug with the frontend, whereby a UserParameter marked as unsupported cannot be reset to monitored?

        Thanks,
        Bryan

        Comment

        Working...