(20260121) Corrected cron flow for in/out summary.

This commit is contained in:
2026-01-21 17:23:15 +05:30
parent 58c47475d6
commit dd6b9fb69a
4 changed files with 299 additions and 1 deletions
+3
View File
@@ -312,6 +312,7 @@ def sync_attendance_to_tcaoff(
cosec_notes = app_notes.get("cosec", {}) cosec_notes = app_notes.get("cosec", {})
if not cosec_notes: continue if not cosec_notes: continue
# print("COSEC NOTES:", cosec_notes) # print("COSEC NOTES:", cosec_notes)
print("Cosec Notes:", cosec_notes)
cosec_id_to_tcaoff_team[cosec_notes["User ID"]] = t cosec_id_to_tcaoff_team[cosec_notes["User ID"]] = t
print("COSEC to TCAOFF TEAMS:", json.to_string(cosec_id_to_tcaoff_team)) print("COSEC to TCAOFF TEAMS:", json.to_string(cosec_id_to_tcaoff_team))
@@ -773,6 +774,7 @@ def today_cron(
except Exception as e: except Exception as e:
print("IN-OUT SUMMARY FETCH FAILED!") print("IN-OUT SUMMARY FETCH FAILED!")
print("EXCEPTION:", e) print("EXCEPTION:", e)
raise
# Log out from TCAOFF: # Log out from TCAOFF:
tcaoff.logout(tcaoff_creds) tcaoff.logout(tcaoff_creds)
@@ -782,6 +784,7 @@ def today_cron(
print("REPORT CRON FAILED LOOP!") print("REPORT CRON FAILED LOOP!")
print("EXCEPTION:", e) print("EXCEPTION:", e)
tcaoff.logout(tcaoff_creds) tcaoff.logout(tcaoff_creds)
raise
# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------
File diff suppressed because one or more lines are too long
@@ -0,0 +1,65 @@
"""
This is a one-time fix script where we need to fix some content of the accounts created.
"""
# Imports:
import os
import pandas as pd
from helpers import tcaoff
from utils_v2.string import json
from utils_v2.system import files
# File paths:
file_dir = files.get_file_directory(include_filename = False)
proj_dir = files.get_parent_directory(file_dir, depth = 1)
tcaoff_creds_file = os.path.join(proj_dir, "creds", "tcaoff.json")
# Load the creds:
tcaoff_creds = json.from_file(tcaoff_creds_file)
# Log in:
tcaoff.login(tcaoff_creds)
# Load the team list:
team_list = tcaoff.team_list(tcaoff_creds)
# Loop through the list,
# check if `applicantNotes` in `json_notes` is a string,
# if it is a string, convert it to a dict/list and update the user:
for team in team_list:
# Extract info:
json_notes = json.from_string(team.get("json_notes", {}))
app_notes = json_notes.get("applicantNotes")
if isinstance(app_notes, str):
app_notes = json.from_string(app_notes)
if not app_notes: continue
# Fix the app notes:
cosec_notes = app_notes.get("cosec", {})
print("COSEC NOTES:", cosec_notes)
cosec_notes = {
"User ID": cosec_notes.get("User ID", cosec_notes.get("UserID")),
"User Name": cosec_notes.get("User Name", cosec_notes.get("UserName")),
"Category Name": cosec_notes.get("Category Name", cosec_notes.get("CategoryName")),
"Grade Name": cosec_notes.get("Grade Name", cosec_notes.get("GradeName")),
"Branch Name": cosec_notes.get("Branch Name", cosec_notes.get("BranchName")),
"Department Name": cosec_notes.get("Department Name", cosec_notes.get("DepartmentName")),
"Direct Reporting": cosec_notes.get("Direct Reporting", cosec_notes.get("DirectReporting")),
"Direct Reporting ID": cosec_notes.get("Direct Reporting ID", cosec_notes.get("DirectReportingID")),
"Level-1 ID": cosec_notes.get("Level-1 ID", cosec_notes.get("Level-1ID")),
}
# Save the JSON Notes again:
json_notes["applicantNotes"] = app_notes
team["json_notes"] = json.to_string(json_notes, no_space = True)
# Make a pandas DataFrame:
team_df = pd.DataFrame(team_list)
# Log out:
tcaoff.logout(tcaoff_creds)
# Show and save the DF:
print(team_df[:10].to_string())
team_df[["user_id", "json_notes"]].to_csv(r"C:\Users\Khushal P Soonderji\Downloads\20260121_cosec_team_fix.csv", index = False)
+230
View File
@@ -0,0 +1,230 @@
# Nivetti NiOS MIBs
The following minimum parameters are required to be discovered to retrieve data using SNMP from Nivetti make Routers, in order to monitor them through a Network Management System (NMS).
---
## Required Minimum Parameters for SNMP Discovery
Standard SYSTEM-MIB is supported
(Details to be configured in System PG)
### System Information
1. System Name
2. System Description
3. System Uptime
4. System Contact
5. System Location
---
## CPU Utilization
1. Current CPU Utilization
OID: .1.3.6.1.4.1.46634.1.2.5.1.1.1.5.1.3.0.1
CPU usage is displayed in tenths of a percent unit.
To get absolute percentage, divide the fetched value by 10.
2. Average CPU Utilization (1 min / 5 min / 15 min)
Currently Not Available
3. Per-Core Utilization
Per-core utilization is not applicable for this device
---
## Memory Utilization
### RAM
- Total Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.6.1.3.0.1
- Used Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.8.1.3.0.1
- Free Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.7.1.3.0.1
- Memory Utilization (%)
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.9.1.3.0.1
---
### Internal Storage (Flash)
- Total Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.6.1.3.0.2
- Used Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.8.1.3.0.2
- Free Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.7.1.3.0.2
- Memory Utilization (%)
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.9.1.3.0.2
---
### User Storage (Flash)
- Total Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.6.1.3.0.3
- Used Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.8.1.3.0.3
- Free Memory
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.7.1.3.0.3
- Memory Utilization (%)
OID: .1.3.6.1.4.1.46634.1.2.5.1.2.1.9.1.3.0.3
---
## Interface Statistics
Standard IF-MIB is supported for both physical and virtual interfaces.
- Interface Name / Description
- Interface Type (Ethernet, Serial, Loopback, etc.)
- Interface Duplex Status
- Interface Status (Up / Down)
- Operational Status (Up / Down)
- Administrative Status (Up / Down)
- Interface IP Address
- Interface Subnet Mask
- Interface Index
- Interface Speed
- Inbound Octets
- Outbound Octets
- Inbound Unicast Packets
- Outbound Unicast Packets
- Inbound Discards
- Outbound Discards
- Inbound Errors
- Outbound Errors
- Input Queue Length
- Output Queue Length
---
## Temperature Sensors
Private MIB / OID
### Current Temperature Readings
- Air Inlet Temperature
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.5.1.3.0.1
- Air Outlet Temperature
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.5.1.3.0.2
- CPU Temperature
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.5.1.3.0.3
### Low Tolerance Thresholds
- Low Air Inlet Tolerance
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.6.1.3.0.1
- Low Air Outlet Tolerance
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.6.1.3.0.2
- Low CPU Tolerance
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.6.1.3.0.3
### High Tolerance Thresholds
- High Air Inlet Tolerance
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.7.1.3.0.1
- High Air Outlet Tolerance
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.7.1.3.0.2
- High CPU Tolerance
OID: .1.3.6.1.4.1.46634.1.2.5.1.3.1.7.1.3.0.3
---
## Power Supply Status
Use: NIOS-CHASSIS-MIB
Displayed only when the power module is ON
### Power Module A
- State
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.4.1.992.0
- Failure Reason
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.5.1.992.0
- Input Voltage
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.6.1.992.0
- Output Voltage
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.7.1.992.0
- Input Current
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.8.1.992.0
- Output Current
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.9.1.992.0
### Power Module B
- State
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.4.1.993.0
- Failure Reason
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.5.1.993.0
- Input Voltage
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.6.1.993.0
- Output Voltage
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.7.1.993.0
- Input Current
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.8.1.993.0
- Output Current
OID: .1.3.6.1.4.1.46634.1.2.5.1.6.1.9.1.993.0
---
## Fan Status
Private MIB / OID
### Fan 1
- State (RPM)
OID: .1.3.6.1.4.1.46634.1.2.5.1.5.1.5.1.255.0.1
- Speed (RPM)
OID: .1.3.6.1.4.1.46634.1.2.5.1.5.1.6.1.255.0.1
### Fan 2
- State
OID: .1.3.6.1.4.1.46634.1.2.5.1.5.1.5.1.255.0.2
- Speed (RPM)
OID: .1.3.6.1.4.1.46634.1.2.5.1.5.1.6.1.255.0.2
### Fan 3
- State
OID: .1.3.6.1.4.1.46634.1.2.5.1.5.1.5.1.255.0.3
- Speed (RPM)
OID: .1.3.6.1.4.1.46634.1.2.5.1.5.1.6.1.255.0.3
---
## Routing Table Information (Summary)
- Number of active routes
- Number of OSPF / BGP neighbors
Currently Not Available
Please share the OIDs being used in the EMS for other devices in the network.
---
## Session Information (NAT)
- Number of active NAT sessions
Additional details required.
Please share the OIDs currently used in the EMS for other devices.
---
## SLA Monitoring Parameters
Additional details required.
Please share the OIDs currently used in the EMS for other devices.
- End-to-End Latency (e.g., ICMP RTT)
- Jitter
- Packet Loss
- SLA Operation Status (Active / Failed)
- SLA Threshold Breach Status