Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Brisseta opened this issue May 6, 2023 · 0 comments
Open

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

Brisseta opened this issue May 6, 2023 · 0 comments

Comments

@Brisseta
Copy link

Brisseta commented May 6, 2023

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant