Skip to content

get facts uptime for Fortigate cluster v7.0.X #1

Open
@Brisseta

Description

Hello,

Found an issue for get_facts function, on Fortigate cluster 7.0.X :
sys_perf_uptime = self._send_command( "get system performance status | grep Uptime" )
Will raise an error.

Fix proposal for cluster :

sys_perf_uptime = self._send_command( "get system status | grep uptime" )

uptime_formatted = ( sys_perf_uptime.replace("Cluster uptime: ", "") .replace(" days,", ":") .replace(" hours,", ":") .replace(" minutes,", ":") .replace(" seconds", ":") )
uptime_dict = dict(zip(("d", "h", "m", "s"), uptime_formatted.split(":"))) uptime = ( int(uptime_dict["s"]) + int(uptime_dict["m"]) * 60 + int(uptime_dict["h"]) * 60 * 60 + int(uptime_dict["d"]) * 60 * 60 * 24 )

Thanks for your work.

Adrien,

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions