Ad Widget

Collapse

Linux Autodiscovery : services, processes, hard disks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghusson
    Junior Member
    • Jul 2012
    • 16

    #1

    Linux Autodiscovery : services, processes, hard disks

    I began with disks monitoring autodiscovery.
    I added process and services autodiscovery.
    File joined gives everything needed
    Do not forget to add a sudo for netstat : zabbix ALL=NOPASSWD: /bin/netstat
    Autodiscovery period is set to 30mn.

    Do not hesitate to make those scripts better !

    Gautier Husson.
    Attached Files
  • Stephen Wood
    Member
    • Feb 2012
    • 43

    #2
    These are really cool, thanks for sharing.

    Also, cheers for making sure you delegate privileges with sudo, or else you could potentially open up a serious security hole!

    Comment

    • Datum
      Junior Member
      • Jul 2012
      • 5

      #3
      Could you provide some more documentation for installation?

      I'm alright at linux stuff but could use some guidance.

      I'd love to give this a shot for a particular server we're struggling with monitoring.

      Comment

      • ghusson
        Junior Member
        • Jul 2012
        • 16

        #4
        Here is the updated package with readme.txt.

        Do not hesitate to tell me if you find this package usefull
        Attached Files

        Comment

        • ghusson
          Junior Member
          • Jul 2012
          • 16

          #5
          Update - services by port, VM name for proxmox VE

          Hello,

          I post my update.
          What is new :
          - Discovery by port
          - display VM names with Proxmox VE 1x and 2x
          - sudo at script level

          Enjoy !
          Attached Files

          Comment

          • dvuong
            Junior Member
            • Aug 2013
            • 2

            #6
            I've been using your script: discover_disk.perl
            Work great, but somehow when I'm dealing with "physical" servers
            the script doesn't populate the #DISKDEV & #DMNAME variable with the proper values. Any idea why?

            on a VM when running discover_disk.perl, I get:

            {
            "{#DISK}":"dm-0",
            "{#DISKDEV}":"/dev/mapper/RootVG00-rootVol",
            "{#DMNAME}":"RootVG00-rootVol",
            "{#VMNAME}":"",
            "{#VMID}":""
            }

            on a physical when running discover_disk.perl, I get:

            {
            "{#DISK}":"dm-0",
            "{#DISKDEV}":"/dev/dm-0",
            "{#DMNAME}":"dm-0",
            "{#VMNAME}":"",
            "{#VMID}":""
            }

            Any idea on how to modify the script?
            Last edited by dvuong; 20-08-2013, 19:32.

            Comment

            • ghusson
              Junior Member
              • Jul 2012
              • 16

              #7
              dvuong :

              This script works with Proxmox VE (at last version 2.x).
              It is not hard to modify it, just try ?
              Values for physical disk are OK : you have :
              "{#DISK}":"dm-0",
              "{#DISKDEV}":"/dev/dm-0",
              "{#DMNAME}":"dm-0",
              "{#VMNAME}":"",
              "{#VMID}":""
              #DISKDEV and #DMNAME are populated.
              #VMNAME and #VMID are not populated, as this is a physical disk.

              Comment

              • Jebrail
                Junior Member
                Zabbix Certified Specialist
                • May 2010
                • 3

                #8
                Hello,

                I get ZBX_NOTSUPPERTED error when querying custom.disks.discovery_perl , zabix version 2.0.2 .

                How do you think what can be reason ?

                Comment

                • jannoke
                  Junior Member
                  • Feb 2014
                  • 4

                  #9
                  I have made the changes. And agent_get replies with correct data.
                  Also have added the regex (see below) and imported xml.
                  I have added the templates to client host.

                  Template Linux disk autodiscovery
                  Template Linux services autodiscovery
                  Template OS Linux


                  For testing have set the discovery interval to 30 seconds. But I don't see any detected graphs.

                  Code:
                  Name	Expressions
                  	File systems for discovery	
                  1	 »	^(btrfs|ext2|ext3|ext4|jfs|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|ntfs|fat32)$	 [Result is TRUE]
                  	Linux disks for autodiscovery	
                  1	 »	^(hd[a-z]+|sd[a-z]+|vd[a-z]+|dm-[0-9]+|drbd[0-9]+)$	 [Result is TRUE]
                  2	 »	^(vzsnap.*|.*-cow|.*-real|ram[0-9]+|loop[0-9]+|sr[0-9]*|fd[0-9]*)$	 [Result is FALSE]
                  	Linux processes for autodiscovery	
                  1	 »	^(mimedefang|named|snmpd|snmptt|nfsd|syslogd|rsyslogd|syslog-ng|slapd|nmbd|inetd|cron|smbd|pvedaemon|ogSoapServ.pl|postgres|java)$	 [Result is TRUE]
                  	Linux TCP services for fordiscovery by name	
                  1	 »	^$	 [Result is FALSE]
                  2	 »	^(rpc.*|proftpd.+)$	 [Result is FALSE]
                  	Linux TCP services for fordiscovery by port	
                  1	 »	^(21|22|25|26|53|80|83|110|111|139|143|443|445|465|540|587|636|652|801|802|842|901|953|993|995|1100|1111|2049|3050|3142|3306|4190|5432|9101|9102|9103|10022|10023|10024|10025|22000|2 8081|28082|28083|28084|28085|28086|28087|28088|28089|28090|50000)$	 [Result is TRUE]
                  	Linux UDP services for fordiscovery by name	
                  1	 »	^$	 [Result is FALSE]
                  2	 »	^(avahi-daemon:|named|snmpd|ntpdate|zabbix_server|smbd|rpc.*|rsyslogd|snmpwalk|proxpolicy\s.*)$	 [Result is FALSE]
                  	Linux UDP services for fordiscovery by port	
                  1	 »	^(53|69|111|123|137|138|161|162|514|1812|1813|2049)$	 [Result is TRUE]
                  	Network interfaces for discovery	
                  1	 »	^Software Loopback Interface	 [Result is FALSE]
                  2	 »	^lo$	 [Result is FALSE]
                  	Storage devices for SNMP discovery	
                  1	 »	^(Physical memory|Virtual memory|Memory buffers|Cached memory|Swap space)$	 [Result is FALSE]

                  Comment

                  • gian72
                    Junior Member
                    Zabbix Certified Specialist
                    • Aug 2009
                    • 14

                    #10
                    Thank you for your scripts and templates, works prefectly...
                    Gianluca

                    Comment

                    • ghusson
                      Junior Member
                      • Jul 2012
                      • 16

                      #11
                      I repacked the thing.
                      Now available on share.zabbix.com :
                      The Zabbix Team has collected all official Zabbix monitoring templates and integrations.

                      Comment

                      • Starko
                        Member
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Aug 2012
                        • 93

                        #12
                        Originally posted by ghusson
                        I repacked the thing.
                        Now available on share.zabbix.com :
                        https://share.zabbix.com/cat-os/cat-...ices-processes
                        The link is dead :/

                        Comment

                        • ghusson
                          Junior Member
                          • Jul 2012
                          • 16

                          #13
                          Thanks Starko.
                          share.zabbix.com is still beta, my contribution vanished
                          New link : https://share.zabbix.com/component/m...ervice?Itemid=

                          BR

                          Comment

                          • Starko
                            Member
                            Zabbix Certified SpecialistZabbix Certified Professional
                            • Aug 2012
                            • 93

                            #14
                            Have you ever thought about posting this project on github? So we could all work on this? This is a pretty good project and an interesting method of implementing it.

                            Comment

                            • ghusson
                              Junior Member
                              • Jul 2012
                              • 16

                              #15
                              Hello,

                              I never thought about it.
                              I touch to this zabbix set one time every 2 years

                              But indeed, it is simple, efficient, quite secure, perfect for lazy sys-admins like me...
                              I would be happy if some people would like to collaborate and enhance it.
                              But I really don't have time to manage that, sorry.

                              If somebody want to take the lead on this, feel free, it would make me happy !

                              Comment

                              Working...