NETGOD ALPHA
Documentation
Configure your FortiGate for read-only monitoring and run your first NetGod collector test.
Before you start
For the alpha, run the collector on a Windows PC that can reach your FortiGate’s private management interface. You’ll need a FortiGate administrator to create the monitoring identities, a stable IPv4 address for the PC, Node.js 24, and a copy of the collector shared with your alpha team.
The collector currently reads SNMPv3 and prints results locally. The REST tutorial below verifies credentials separately in preparation for the REST connector. Live inventory in the cloud portal is planned.
Configure SNMPv3
- In FortiOS, open Network → Interfaces. Allow SNMP on the private management interface used by the PC, preserving its existing access settings.
- Open System → SNMP, enable the SNMP agent and create an SNMP v3 user named
netgod-monitor. - Choose Authentication and Private (
authPriv), with SHA256 and AES-128 (shown as AES on some FortiGate releases). Set two distinct passphrases. Enable queries on UDP 161 and leave traps disabled for this test. - For a shared management network, coordinate a Local-In rule for UDP 161 that restricts access to the collector’s source IP. Review existing management access and rule order before applying it.
Test the collector on Windows
In PowerShell, open the NetGod project folder. Install the locked dependencies and make a local copy of the example configuration if you haven’t created one yet.
npm ci --ignore-scripts
if (-not (Test-Path 'collector/config.local.json')) {
Copy-Item 'collector/config.example.json' 'collector/config.local.json'
}
notepad 'collector/config.local.json'
Replace the example host with the private FortiGate IPv4 address. Keep lab-fortigate as the device ID and netgod-monitor as the username if you followed the setup above. Save the file with the example’s environment-variable names.
npm --silent run collector -- validate collector/config.local.json
Enter the SHA256 and AES passphrases at the masked prompts. The variables are cleared after the test.
try {
$env:NETGOD_SNMP_FGT_AUTH = [System.Net.NetworkCredential]::new('', (Read-Host 'SNMP auth' -AsSecureString)).Password
$env:NETGOD_SNMP_FGT_PRIVACY = [System.Net.NetworkCredential]::new('', (Read-Host 'SNMP privacy' -AsSecureString)).Password
npm --silent run collector -- test collector/config.local.json lab-fortigate
} finally {
Remove-Item Env:NETGOD_SNMP_FGT_AUTH, Env:NETGOD_SNMP_FGT_PRIVACY -ErrorAction SilentlyContinue
}
A response contains the system name, description, object ID, uptime and interface count when available. partial lists fields the agent didn’t return. For all configured devices, use snapshot in place of test and omit the device ID while the corresponding secrets are available.
Create a read-only API account
- Under System → Admin Profiles, create
netgod-readonly. Grant Read to the Firewall category for this API test and leave unrelated permissions at None. - Under System → Administrators → Create New → REST API Admin, create
netgod-apiwith that profile. Limit it to the required VDOM and the collector PC’s IPv4 address as a Trusted Host with a/32mask. Leave CORS disabled. - Save the generated token in your password manager. Use the management hostname that matches the FortiGate’s TLS certificate and verify that Windows trusts the issuer.
$fortigate = 'https://YOUR-FORTIGATE-MANAGEMENT-NAME'
$token = [System.Net.NetworkCredential]::new('', (Read-Host 'FortiGate API token' -AsSecureString)).Password
try {
$result = Invoke-RestMethod -Uri "$fortigate/api/v2/cmdb/firewall/address?format=name" -Headers @{ Authorization = "Bearer $token" } -Method Get -MaximumRedirection 0
$result | Select-Object status, http_status, vdom
} finally {
Remove-Variable token, result -ErrorAction SilentlyContinue
}
The expected result is success with HTTP 200. This test prints only the status and VDOM.
Troubleshoot access
- SNMP timeout
- Check the management address, interface access, UDP 161, Local-In rules, and both SNMPv3 passphrases. A FortiGate can drop a request silently when its settings don’t match.
- API returns 401 or 403
- Check the token, the PC’s current source IP, the API account profile and the allowed VDOM.
- Certificate verification error
- Check the management hostname and trust chain. Have the administrator provide the correct certificate or issuing CA before retrying.
For alpha support, share the FortiGate model, FortiOS version and test status. Keep passphrases, API tokens, policy contents and raw inventory private.