Ad Widget

Collapse

How to monitor Fortigate 100D

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jepoytengco
    Junior Member
    • Nov 2016
    • 22

    #1

    How to monitor Fortigate 100D

    Hi, I've downloaded the Zabbix-Fortinet templates for CPU, RAM, Interface, etc and I've also import it in.

    My Zabbix version is: 2.4.8

    Whenever I add the Fortigate host, go to Templates tab, add the Zabbix-Fortinet templates but as soon as I clicked on update, it shows me an error message

    Cannot find host interface on "FW IP" for item key fgProcessorEntIndex"

    I tried to add under Host tab a SNMP interfaces which has an address of 127.0.0.1 and clicked update, it did push thru but snmp is in red saying timeout.

    Did I lack something?

    Thanks
    Jeff
  • WillemR
    Member
    • Oct 2015
    • 30

    #2
    Hi,

    it's not clear to me, you have issues importing the templates, or create the host and assigning it to a template?

    I assume you use the jjmatres fortigates template ?
    If so, you have to create some keys in your zabbix server

    You can achive this going to:
    Administration, General, on your right choose 'value mappings'

    there you have to create each value mapping, you can find which ones to make on the github page of jjmatres.

    Also don't forget to set your macro's on the template, or host.
    {$INTF_REGEX} --> with value: -p-|-P-|-pe-|-PE-
    {$SNMP_COMMUNITY} --> with value: "whatever you have set on the fortigate

    Comment

    • jepoytengco
      Junior Member
      • Nov 2016
      • 22

      #3
      Apologies, just for clarity, Yes you are correct, I was able to import the Templates which came from this URL:



      I saw the General > Administration and created a value mapping.

      Apologies, since this is the first time I'll be doing this, I'm really noob at this, 1st: what do you mean by value mapping and how do I do this? When I clicked on "Create valu map"

      I see "Name" and under "Mappings" I see Value = Mapped to then an Add and Cancel button.

      Please advise and Thanks in advance
      Jeff

      Comment

      • WillemR
        Member
        • Oct 2015
        • 30

        #4
        no need for apologies. I understand how difficult it is to get going on linux (i just founded blog.oper-init.eu, just to write down my progress on zabbix, but cause a lack of time i haven't updated it to zabbix 3.0)

        for example, when you try to import the following template, you should get an error about "value mappings"




        when you read about the manual of install you'll see you have to create first some value mappings before importing the template

        For example:

        Add a value mapping named FgBoolState with the following values:

        1 => disabled
        2 => enabled


        So go to the Adminstration, general, Value mapping (on the right of the screen), name = FgBoolState.

        Press "Add" once, you should have a matrix 2 on 2

        in the value fields
        Value
        1 disabled
        2 enabled

        see attachment for image
        Attached Files

        Comment

        • jepoytengco
          Junior Member
          • Nov 2016
          • 22

          #5
          I see, that really helped me WillemR. Really appreciate the effort and time. The sample you've gave me was for HA: High Availability. How about for example, Template for Interface, since I guess network or connectivity is the most common and usual we would like to monitor. I've opened up the template for interfaces and I don't see value mappings. Based from the Installation Part, it says

          Install if.speed in the ExternalScripts directory of your Zabbix server and/or proxy. Check your zabbix_server.conf and/or zabbix_proxy.conf if in doubt.
          Then chmod a+x if.speed
          Install if.vdom in the ExternalScripts directory of your Zabbix server and/or proxy. Check your zabbix_server.conf and/or zabbix_proxy.conf if in d>
          Then chmod a+x if.vdom
          Import zbx-fortinet-interfaces.xml file into Zabbix.
          Add to your host the {$SNMP_COMMUNITY} macro with your SNMP community as value.
          Add to your host the {$INTF_REGEX} macro with your regular expression as value (ex: -p-|-P-|-pe-|-PE-)
          Associate ZBX-FORTINET-INTERFACES template to the host.

          Correct me if I'm wrong, So, I'm guessing there's no adding under value mappings instead more on modification on the conf file.

          Thanks
          Jeff

          Comment

          • WillemR
            Member
            • Oct 2015
            • 30

            #6
            Originally posted by jepoytengco
            I see, that really helped me WillemR. Really appreciate the effort and time. The sample you've gave me was for HA: High Availability. How about for example, Template for Interface, since I guess network or connectivity is the most common and usual we would like to monitor. I've opened up the template for interfaces and I don't see value mappings. Based from the Installation Part, it says

            Install if.speed in the ExternalScripts directory of your Zabbix server and/or proxy. Check your zabbix_server.conf and/or zabbix_proxy.conf if in doubt.
            Then chmod a+x if.speed
            Install if.vdom in the ExternalScripts directory of your Zabbix server and/or proxy. Check your zabbix_server.conf and/or zabbix_proxy.conf if in d>
            Then chmod a+x if.vdom
            Import zbx-fortinet-interfaces.xml file into Zabbix.
            Add to your host the {$SNMP_COMMUNITY} macro with your SNMP community as value.
            Add to your host the {$INTF_REGEX} macro with your regular expression as value (ex: -p-|-P-|-pe-|-PE-)
            Associate ZBX-FORTINET-INTERFACES template to the host.

            Correct me if I'm wrong, So, I'm guessing there's no adding under value mappings instead more on modification on the conf file.

            Thanks
            Jeff
            from the manual:

            it says the following:

            "
            Install if.speed in the ExternalScripts directory of your Zabbix server and/or proxy. Check your zabbix_server.conf and/or zabbix_proxy.conf if in doubt
            "

            so check your zabbix-server config file and look for the externalscripts folder.

            In there, you should create a file "if.speed" with contents: https://raw.githubusercontent.com/jj...speed/if.speed

            to make your file executable you should tell linux this with the following command: "chmod a+x if.speed"


            note that if your monitorring through a proxy, the externalscript should be placed on the proxy.

            it's the same as for : https://raw.githubusercontent.com/jj...f.vdom/if.vdom

            i'm not sure anymore, but there is a "requre" missing in the script, let me know how it goes.

            Comment

            • jepoytengco
              Junior Member
              • Nov 2016
              • 22

              #7
              Ok, I think when you say Install on the Readme doc, it mean creating the file (touch command). So here's what I did:

              In my server, the externalscripts is located in

              /usr/lib/zabbix/externalscripts

              In this folder, I typed in ls and found no "if.speed" file, so what I did was

              touch if.speed and vi(modify) the if.speed file and paste this script:


              # Query SNMP OID ifSpeed and ifHighSpeed
              if_speed = Array.new
              SNMP::Manager.open(:host => OPTIONS[:deviceip], :community => OPTIONS[:community], :version => :SNMPv2c) do |manager|
              response = manager.get(["IF-MIB::ifSpeed.#{OPTIONS[:snmpindex]}","IF-MIB::ifHighSpeed.#{OPTIONS[:snmpindex]}"])
              response.each_varbind do |vb|
              if_speed.push(vb.value.to_s)
              end
              end

              if if_speed.any?
              ifSpeed = if_speed[0].to_i
              ifHighSpeed = (if_speed[1].to_i)*1000000
              if ifSpeed < 4294967294
              puts ifSpeed
              exit(-1)
              else
              puts ifHighSpeed
              exit(-1)
              end
              else
              puts "-- ERROR -- : No response receive from #{OPTIONS[:deviceip]} !"
              exit(-1)
              end


              changed the deviceip into the ip address of the zabbix server and changed the community name

              Am I still missing something?

              Thanks
              Jeff

              Comment

              • WillemR
                Member
                • Oct 2015
                • 30

                #8
                you should not edit the script.
                Second, did you made the script executable? (chmod a+x if.speed)
                Tirthly, did you set macro's on the host?

                {$SNMP_COMMUNITY} => zabbix

                did you install ruby? (yum install ruby)
                did you install ruby gems snmp? (gem install snmp)

                Comment

                • jepoytengco
                  Junior Member
                  • Nov 2016
                  • 22

                  #9
                  As for the script, I've revert it back to the original script.

                  Yes, I typed that command to make sure it is executable

                  Yes, I've set the macros. {$SNMP_COMMUNITY}

                  installed both ruby and snmp. Waited for some time and I can see snmp icon in red, saying "timeout while connecting to 127.0.0.1:161

                  Thanks
                  Jeff

                  Comment

                  • WillemR
                    Member
                    • Oct 2015
                    • 30

                    #10
                    Originally posted by jepoytengco
                    As for the script, I've revert it back to the original script.

                    Yes, I typed that command to make sure it is executable

                    Yes, I've set the macros. {$SNMP_COMMUNITY}

                    installed both ruby and snmp. Waited for some time and I can see snmp icon in red, saying "timeout while connecting to 127.0.0.1:161

                    Thanks
                    Jeff
                    Hi,

                    So far so good, next you'll have to configure the fortigate to open up the snmp on the internal interface and set the community name.
                    Next set the right ip address (in snmp) in your host in zabbix;

                    Comment

                    • jepoytengco
                      Junior Member
                      • Nov 2016
                      • 22

                      #11
                      Actually the snmp on the Fortigate 100D has been setup already and to verify this, besides the zabbix server that will monitor this, we also have a test cacti machine which is already working.

                      The only thing that's lacking is setting the snmp on the zabbix machine.

                      I'll try to reasearch this one and will get back to you WillemR

                      Thanks
                      Jeff

                      Comment

                      • jepoytengco
                        Junior Member
                        • Nov 2016
                        • 22

                        #12
                        The SNMP on the Fortigate has been setup already since we have a test cacti server that's already working.

                        I'm trying to figure out where can I set the snmp community name, port and host on the zabbix server. I've seen some replies from forums saying that it should be under Configuration > Items but I don't see this Items tab

                        Thanks
                        Jeff

                        Comment

                        • WillemR
                          Member
                          • Oct 2015
                          • 30

                          #13
                          Originally posted by jepoytengco
                          The SNMP on the Fortigate has been setup already since we have a test cacti server that's already working.

                          I'm trying to figure out where can I set the snmp community name, port and host on the zabbix server. I've seen some replies from forums saying that it should be under Configuration > Items but I don't see this Items tab

                          Thanks
                          Jeff
                          You can set this on the Host, Macro's, or under templates, macro's.
                          It's up to you to choose, if you have multiple fortigate's and find it's easier to have one {$SNMP_COMMUNITY} name for all of your fortigate's, you set it under the template, otherwise, you'll set it under the host

                          When you use jjmatres templates, and look under a template item, you'll see he does a reference to a variable {$SNMP_COMMUNITY}. So there is no need to change the items.

                          Comment

                          • jepoytengco
                            Junior Member
                            • Nov 2016
                            • 22

                            #14
                            Sorry I wasn't able to update on the progress due to an OB last week. Unfortunately it didn't work for me, what I will do is re setup from the beginning and check if it will work.

                            Thanks
                            Jeff

                            Comment

                            • WillemR
                              Member
                              • Oct 2015
                              • 30

                              #15
                              Originally posted by jepoytengco
                              Sorry I wasn't able to update on the progress due to an OB last week. Unfortunately it didn't work for me, what I will do is re setup from the beginning and check if it will work.

                              Thanks
                              Jeff
                              Can you post a screenshot with the host macro's and template macro's ?

                              Comment

                              Working...