riskersen / Monitoring

Monitoring plugins wich are Nagios/icinga compatible
65 stars 113 forks source link

check_fortigate: Help output not working #14

Closed Napsty closed 8 years ago

Napsty commented 8 years ago

Tried to see the output of help but didn't work. According to the source code this should be the "-?" or "--help" option.

# ./check_fortigate.pl -?; date
Wed Jan 13 09:26:40 CET 2016

# ./check_fortigate.pl --help; date
Wed Jan 13 09:30:08 CET 2016

Perl version:

 # perl -v | grep "This is"
This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-gnu-thread-multi

This is on Ubuntu 14.04 LTS.

Thanks for checking and for this plugin.

riskersen commented 8 years ago

Should be fixed with c1be458ae8b639ba5e8cc21bb6ad37fa600acb4d

Could you please test?

Napsty commented 8 years ago

Working now with this commit. Thanks!

$ ./check_fortigate.pl --help
NAME
    Check Fortinet FortiGate Appliances

SYNOPSIS
    check_fortigate.pl -H -C -T [-w|-c|-S|-s|-R|-M|-V|-U|-A|-a|-X|-x|-h|-?]

OPTIONS
    -H|--host
    STRING or IPADDRESS - Check interface on the indicated host

    -P|--port
    INTEGER - SNMP Port on the indicated host, defaults to 161

    -v|--version INTEGER - SNMP Version on the indicated host, possible
    values 1,2,3 and defaults to 2

  SNMP V3
    -U|--username STRING - username
    -A|--authpassword STRING - authentication password
    -a|--authprotocol STRING - authentication algorithm, defaults to sha
    -X|--privpassword STRING - private password
    -x|--privprotocol STRING - private algorithm, defaults to aes

  SNMP v1/v2c
    -C|--community STRING - Community-String for SNMP, defaults to public
    only used with SNMP version 1 and 2

  Other
    -T|--type STRING - CPU, MEM, Ses, VPN, net, Cluster, wtp, hw, fazcpu,
    fazmem, fazdisk
    -S|--serial STRING - Primary serial number.
    -s|--slave BOOL - Get values of slave
    -w|--warning INTEGER - Warning threshold, applies to cpu, mem, session,
    fazcpu, fazmem, fazdisk.
    -c|--critical INTEGER - Critical threshold, applies to cpu, mem, session
    fazcpu, fazmem, fazdisk.
    -R|--reset BOOL - Resets ip file (cluster only)
    -M|--mode STRING - Output-Mode: 0 => just print, 1 => print and show
    failed tunnel, 2 => critical
    -V|--vpnmode STRING - VPN-Mode: both => IPSec & SSL/OpenVPN, ipsec =>
    IPSec only, ssl => SSL/OpenVPN only
    -p|--path STRING - Path to store serial filenames

DESCRIPTION
    This plugin checks Fortinet FortiGate devices via SNMP

  From Web
    1. Select Network -> Interface -> Local interface
    2. Administrative Access: Enable SNMP
    3. Select Config -> SNMP
    4. Enable SNMP, fill your details
    5. SNMP v1/v2c: Create new
    6. Configure for your needs, Traps are not required for this plugin!

  From CLI
    config system interface
    edit "internal"
    set allowaccess ping https ssh snmp fgfm
    next
    end
    config system snmp sysinfo
    set description "DMZ1 FortiGate 300C"
    set location "Room 404"
    set conctact-info "BOFH"
    set status enable
    end
    config system snmp community
    edit 1
    set events cpu-high mem-low fm-if-change
    config hosts
    edit 1
    set interface "internal"
    set ip %SNMP Client IP%
    next
    end
    set name "public"
    set trap-v1-status disable
    set trap-v2c-status disable
    next
    end

    Thats it!