FortiPower / PowerFGT

PowerShell module to manage Fortinet (FortiGate) Firewall
Apache License 2.0
108 stars 36 forks source link

Interface Physical up or down? #269

Open AdamSystima opened 1 month ago

AdamSystima commented 1 month ago

Hi There,

Using Get-FGTSystemInterface is there a way to determine if an interface is physically up or down? I couldn't see anything apart from status which i'm guessing is showing if the interface is enabled or disabled?

Thanks for a great piece of software!

alagoutte commented 1 month ago

hi @AdamSystima !

yes Get-FGTSystemInterface get the configuration of the interface

i think, there it is a API monitor call for get the physical information.. i will check

alagoutte commented 1 month ago

After a quick check, there is monitor call api (api/v2/monitor/system/interface)

(Invoke-FGTRestMethod "api/v2/monitor/system/interface").results      

port1  : @{id=port1; name=port1; alias=; mac=00:50:56:90:6a:60; ip=10.200.4.141; mask=24; link=True; speed=10000; duplex=1; tx_packets=1056819; rx_packets=2320492; tx_bytes=629145778; 
         rx_bytes=983055920; tx_errors=0; rx_errors=0}
port2  : @{id=port2; name=port2; alias=; mac=00:50:56:90:f3:54; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=7; rx_packets=228; tx_bytes=746; rx_bytes=62440; 
         tx_errors=0; rx_errors=0}
port3  : @{id=port3; name=port3; alias=; mac=00:50:56:90:d0:2b; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=7; rx_packets=228; tx_bytes=746; rx_bytes=62440; 
         tx_errors=0; rx_errors=0}
port4  : @{id=port4; name=port4; alias=; mac=00:50:56:90:19:ed; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=8; rx_packets=228; tx_bytes=840; rx_bytes=62440; 
         tx_errors=0; rx_errors=0}
port5  : @{id=port5; name=port5; alias=; mac=00:50:56:90:a2:db; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=7; rx_packets=228; tx_bytes=746; rx_bytes=62440; 
         tx_errors=0; rx_errors=0}
port6  : @{id=port6; name=port6; alias=; mac=00:50:56:90:7a:78; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=7; rx_packets=228; tx_bytes=746; rx_bytes=62440; 
         tx_errors=0; rx_errors=0}
port7  : @{id=port7; name=port7; alias=; mac=00:50:56:90:9c:dc; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=8; rx_packets=11; tx_bytes=896; rx_bytes=660; 
         tx_errors=0; rx_errors=0}
port8  : @{id=port8; name=port8; alias=; mac=00:50:56:90:5f:58; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=8; rx_packets=12; tx_bytes=936; rx_bytes=746; 
         tx_errors=0; rx_errors=0}
port9  : @{id=port9; name=port9; alias=; mac=00:50:56:90:25:c6; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=7; rx_packets=228; tx_bytes=746; rx_bytes=62440; 
         tx_errors=0; rx_errors=0}
port10 : @{id=port10; name=port10; alias=; mac=00:50:56:90:59:2f; ip=0.0.0.0; mask=0; link=True; speed=10000; duplex=1; tx_packets=7; rx_packets=228; tx_bytes=746; rx_bytes=62440; 
         tx_errors=0; rx_errors=0}

and you can look link value

I will look to add Get-FGTMonitorSystemInterface (@CedricMoreau)