Ad Widget

Collapse

User/Group that executes the SMS media to /dev/ttyS0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • entorno
    Junior Member
    • Dec 2006
    • 21

    #1

    User/Group that executes the SMS media to /dev/ttyS0

    Hello all,

    I've got two Zabbix boxes running. One for testing / learning, the other being one that we will use in production.

    The test box is a SLES10, and the production box is a CentOS 4.4

    When I was testing with SMS media on the SLES, I had to chmod o+rw /dev/ttyS0 , which just was a temp fix.

    However, now on the CentOS, I need to know which user zabbix sends the SMS's as, as it does not have permision to use /dev/ttyS0.

    Anyone tell me which user it is please?

    Many thanks
  • Calimero
    Senior Member
    • Nov 2006
    • 481

    #2
    Didn't you create a zabbix user and a zabbix group when installing zabbix ?

    Anyway "ps aux | grep zabbix_server" will tell you what user zabbix is running as.

    Comment

    • entorno
      Junior Member
      • Dec 2006
      • 21

      #3
      yeah, I added zabbix user and group

      Just added him to the group used by the device... see if it works.

      Comment

      • entorno
        Junior Member
        • Dec 2006
        • 21

        #4
        nope...

        However it does work if I chmod o+rw /dev/ttyS0

        So, it's not sending the SMS as user zabbix :-|

        Any developer who could advise please?

        Kind regards

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          If ZABBIX server is running under user 'zabbix', group 'zabbix', then obviously the device must have read-write permissions for either user or group 'zabbix'.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • entorno
            Junior Member
            • Dec 2006
            • 21

            #6
            Hi Alexei,

            As I said, I tried that. I added the user "zabbix" to the group used by the device:

            uucp:x:14:uucp,zabbix

            The zabbix user can send strings to ttyS0 no problem, yet the webUI reported it was unable to open /dev/ttyS0 in the error column.

            The only way so far to get it to work is to add "other" rw perms.... so I guess when Zabbix sends the SMS message, it is not as user zabbix.. would you agree?

            Comment

            • Calimero
              Senior Member
              • Nov 2006
              • 481

              #7
              Originally posted by entorno
              yeah, I added zabbix user and group

              Just added him to the group used by the device... see if it works.
              Log in (or "su") as zabbix and issue the command "id". It will list what groups zabbix is in.

              It should output something like:
              zabbix@hostname:~$ id
              uid=1000(zabbix) gid=1000(zabbix) groups=1000(zabbix),1001(group_for_device)

              Permissions on the device are of course g+w I guess ?

              By the way did you restart zabbix server ? There's some kind of caching (per session ?) I think.

              Comment

              • entorno
                Junior Member
                • Dec 2006
                • 21

                #8
                [zabbix@zabbix ~]$ id
                uid=501(zabbix) gid=501(zabbix) groups=14(uucp),501(zabbix)

                The box had a reboot after... so yeah, the zabbix_server has been restarted

                Comment

                • Calimero
                  Senior Member
                  • Nov 2006
                  • 481

                  #9
                  What aboud ownership/permissions of the device (ls -l) ?

                  Comment

                  • entorno
                    Junior Member
                    • Dec 2006
                    • 21

                    #10
                    Hi, as I've said,

                    it's now been set to:

                    crw-rw-rw- 1 root uucp 4, 64 Dec 19 13:56 /dev/ttyS0

                    And Zabbix sends SMS messages ok...

                    However, when it's set to:

                    crw-rw---- 1 root uucp 4, 64 Dec 19 13:56 /dev/ttyS0

                    It can't open the device :-\

                    Comment

                    • artesvida
                      Junior Member
                      • May 2007
                      • 18

                      #11
                      zabbix user permissions

                      Has anyone found a solution/explanation? I have the same problem:

                      1) zabbix_server running under the "zabbix" user account:
                      ps -ef | grep zabbix
                      zabbix 3341 1 0 May04 ? 00:00:08 /usr/local/bin/zabbix_server
                      zabbix 3422 3341 0 May04 ? 00:00:00 /usr/local/bin/zabbix_server
                      zabbix 3423 3341 0 May04 ? 00:00:00 /usr/local/bin/zabbix_server
                      zabbix 3424 3341 0 May04 ? 00:01:20 /usr/local/bin/zabbix_server
                      zabbix 3425 3341 0 May04 ? 00:00:25 /usr/local/bin/zabbix_server
                      zabbix 3426 3341 0 May04 ? 00:34:37 /usr/local/bin/zabbix_server
                      zabbix 3427 3341 0 May04 ? 00:00:00 /usr/local/bin/zabbix_server
                      zabbix 3428 3341 0 May04 ? 00:00:00 /usr/local/bin/zabbix_server
                      zabbix 3429 3341 0 May04 ? 00:00:00 /usr/local/bin/zabbix_server
                      zabbix 3430 3341 0 May04 ? 00:00:00 /usr/local/bin/zabbix_server
                      zabbix 3431 3341 0 May04 ? 00:00:00 /usr/local/bin/zabbix_server
                      me 20737 23731 0 11:07 pts/0 00:00:00 grep zabbix

                      2) zabbix user account in the "dialout" group:
                      me@server:~$ su zabbix
                      Password:
                      zabbix@server:/home/me$ id
                      uid=1001(zabbix) gid=1001(zabbix) groups=20(dialout),110(admin),1001(zabbix)

                      3) modem is on /dev/ttyS1:
                      ls -l /dev/ttyS1
                      crw-rw---- 1 root dialout 4, 65 2007-05-04 09:43 /dev/ttyS1

                      4) I can successfully open the modem when I su to the zabbix user.

                      5) zabbix_server daemon fails to open the modem, unless I open it up to everyone (chmod 666 /dev/ttyS1).

                      6) Yes, I have restarted the zabbix_server daemon, and I have also restarted the server.

                      I don't really want to open the modem up to everyone, and besides it should just work. Anyone figure out why this is happening?

                      Comment

                      • Alexei
                        Founder, CEO
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Sep 2004
                        • 5654

                        #12
                        Do you start ZABBIX server uder root account? If so, the daemon automatically changes its ownership to zabbix:zabbix during startup sequence.
                        Alexei Vladishev
                        Creator of Zabbix, Product manager
                        New York | Tokyo | Riga
                        My Twitter

                        Comment

                        • artesvida
                          Junior Member
                          • May 2007
                          • 18

                          #13
                          Yes, it's started under the root account.

                          So, since I see that you keep referring to the daemon's ownership as zabbix:zabbix, does that mean that it doesn't matter that the zabbix user is also a member of the "dialout" group? Is the zabbix_server daemon going to have ONLY the permissions of the zabbix user and the zabbix group?

                          Comment

                          • Alexei
                            Founder, CEO
                            Zabbix Certified Trainer
                            Zabbix Certified SpecialistZabbix Certified Professional
                            • Sep 2004
                            • 5654

                            #14
                            Exactly! ZABBIX gets uid and gid from /etc/password and sets ownership of running zabbix_server accordingly. It ignores secondary groups.

                            You may either start ZABBIX under 'zabbix' or change primary group to 'uucp'.
                            Alexei Vladishev
                            Creator of Zabbix, Product manager
                            New York | Tokyo | Riga
                            My Twitter

                            Comment

                            • rugwiza
                              Junior Member
                              • Jan 2013
                              • 16

                              #15
                              Sms

                              Dear Entorno,
                              I ve followed the conversations you did with senior members, and eventually u succeeded to configure zabbix to send sms.
                              As I am new to the monitoring system, can u please a step-by-step scenario on how to do it?
                              Thanks

                              Comment

                              Working...