Ad Widget

Collapse

UserParameter Permission denied

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miramira007
    Member
    • Sep 2015
    • 89

    #1

    UserParameter Permission denied

    Hey all,

    sorry for asking such a dummy question. But yet i haven't got anyone to ask. Maybe someone here can help me.

    I want to monitor a deamon in centos via UserParameter.

    To testing i created in server x zabbix agent a UserParameter, which looks like this here:
    UserParameter=services.check.name, sudo systemctl status name | grep -c running

    Gave zabbix all privilegies via visudo. the copy is here:

    zabbix ALL=(ALL) ALL

    I know it isn't the best way (maybe the dirtiest one, but this all is just a testing now)

    After creating an item, i have got an error. This one:
    sh: /usr/bin/sudo: Permission denied
    0

    What should i do? I haven't got an idea, where the problem can be.

    I think i made a mistake in the sudoers file? First i edited it with nano! Maybe this can be the reason?

    Thanks a lot,
    mira
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    Hi,

    Few suggestions:
    1. Try editing the file with command "visudo"
    2. Instead of zabbix ALL=(ALL) ALL add the following line:
    Code:
    zabbix ALL = NOPASSWD: /sbin/systemctl
    Otherwise it will still ask for password when executing this command.

    Hope this helps!

    Best Regards,
    Ingus

    Comment

    • miramira007
      Member
      • Sep 2015
      • 89

      #3
      Thank you for your answer,

      i edited the sudoers file with visudo like your suggestion, but it hasn't changed anything

      Maybe an other idea? My Zabbix Server and Agent are running on a CentOS 7. Both are in version 2.4.7.

      Comment

      • ingus.vilnis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Mar 2014
        • 908

        #4
        If possible, temporary disable SELinux and try again if that helps.
        Code:
        setenforce 0
        Then check /var/log/audit for zabbix agentd related errors. Create policies if needed.

        Best Regards,
        Ingus

        Comment

        • miramira007
          Member
          • Sep 2015
          • 89

          #5
          For testing i disabled SElinux,
          added this in /etc/sudoers

          Defaults: user !requiretty

          And now it works.

          Im such a dummy! I know i havent got to say it, because you can notice that from my question!

          Thanks a lot.
          mira

          Comment

          Working...