Skip to content

Commit 33d6e4f

Browse files
Added code for CSCwo96334:/tmp directory disk space for snapshot storage
1 parent 68f3673 commit 33d6e4f

5 files changed

Lines changed: 283 additions & 12 deletions

File tree

aci-preupgrade-validation-script.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,7 +2982,7 @@ def scalability_faults_check(**kwargs):
29822982

29832983

29842984
@check_wrapper(check_title="APIC Disk Space Usage (F1527, F1528, F1529 equipment-full)")
2985-
def apic_disk_space_faults_check(cversion, **kwargs):
2985+
def apic_disk_space_faults_check(cversion, tversion,**kwargs):
29862986
result = FAIL_UF
29872987
headers = ['Fault', 'Pod', 'Node', 'Mount Point', 'Current Usage %', 'Recommended Action']
29882988
data = []
@@ -2992,15 +2992,17 @@ def apic_disk_space_faults_check(cversion, **kwargs):
29922992
recommended_action = {
29932993
'/firmware': 'Remove unneeded images',
29942994
'/techsupport': 'Remove unneeded techsupports/cores',
2995-
'/data/log': 'Remove unneeded logs in var/log/dme/log'
2995+
'/data/log': 'Remove unneeded logs in var/log/dme/log',
2996+
'/tmp': 'Remove unneeded logs in /tmp directory'
29962997
}
29972998
default_action = 'Contact Cisco TAC.'
29982999
if cversion.same_as('4.0(1h)') or cversion.older_than('3.2(6i)'):
29993000
default_action += ' A typical issue is CSCvn13119.'
30003001

30013002
dn_regex = node_regex + r'/.+p-\[(?P<mountpoint>.+)\]-f'
30023003
desc_regex = r'is (?P<usage>\d{2,3}%) full'
3003-
3004+
3005+
tmp_faults_skipped = False # Track if we skip /tmp faults for tversion >= 6.1(4a)
30043006
faultInsts = icurl('class',
30053007
'faultInst.json?query-target-filter=or(eq(faultInst.code,"F1527"),eq(faultInst.code,"F1528"),eq(faultInst.code,"F1529"))')
30063008
for faultInst in faultInsts:
@@ -3010,14 +3012,24 @@ def apic_disk_space_faults_check(cversion, **kwargs):
30103012
fc = faultInst['faultInst']['attributes']['code']
30113013
dn = re.search(dn_regex, faultInst['faultInst']['attributes']['dn'])
30123014
desc = re.search(desc_regex, faultInst['faultInst']['attributes']['descr'])
3013-
if dn and desc:
3014-
data.append([fc, dn.group('pod'), dn.group('node'), dn.group('mountpoint'),
3015+
if dn:
3016+
mountpoint = dn.group('mountpoint')
3017+
# CSCwo96334: Skip /tmp faults if tversion >= 6.1(4a) (snapshots use /data instead)
3018+
if mountpoint == '/tmp' and tversion and not tversion.older_than("6.1(4a)"):
3019+
tmp_faults_skipped = True
3020+
continue
3021+
if desc:
3022+
data.append([fc, dn.group('pod'), dn.group('node'), dn.group('mountpoint'),
30153023
desc.group('usage'),
30163024
recommended_action.get(dn.group('mountpoint'), default_action)])
3017-
else:
3018-
unformatted_data.append([fc, faultInst['faultInst']['attributes']['dn'], default_action])
3025+
else:
3026+
unformatted_data.append([fc, faultInst['faultInst']['attributes']['dn'], default_action])
30193027
if not data and not unformatted_data:
3020-
result = PASS
3028+
# If we only found /tmp faults that were skipped (tversion >= 6.1(4a)), return NA
3029+
if tmp_faults_skipped:
3030+
result = NA
3031+
else:
3032+
result = PASS
30213033
return Result(
30223034
result=result,
30233035
headers=headers,

tests/checks/apic_disk_space_faults_check/Fault_combination.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,95 @@
8888
"type": "operational"
8989
}
9090
}
91+
},
92+
93+
{
94+
"faultInst": {
95+
"attributes": {
96+
"ack": "no",
97+
"alert": "no",
98+
"cause": "equipment-full",
99+
"changeSet": "inodesFree (Old: 12167881, New: 12167880), inodesUsed (Old: 64, New: 65)",
100+
"childAction": "",
101+
"code": "F1529",
102+
"created": "2026-03-13T11:46:02.307+00:00",
103+
"delegated": "no",
104+
"descr": "Storage unit /tmp on node 1 with hostname fab3-apic1 mounted at /tmp is 100% full",
105+
"dn": "topology/pod-1/node-1/sys/ch/p-[/tmp]-f-[tmpfs]/fault-F1529",
106+
"domain": "infra",
107+
"highestSeverity": "critical",
108+
"lastTransition": "2026-03-13T11:48:02.867+00:00",
109+
"lc": "raised",
110+
"occur": "1",
111+
"origSeverity": "critical",
112+
"prevSeverity": "critical",
113+
"rule": "eqpt-storage-full-critical",
114+
"severity": "critical",
115+
"status": "",
116+
"subject": "equipment-full",
117+
"title": "",
118+
"type": "operational"
119+
}
120+
}
121+
},
122+
123+
{
124+
"faultInst": {
125+
"attributes": {
126+
"ack": "no",
127+
"alert": "no",
128+
"cause": "equipment-full",
129+
"changeSet": "inodesFree (Old: 12167881, New: 12167880), inodesUsed (Old: 64, New: 65)",
130+
"childAction": "",
131+
"code": "F1528",
132+
"created": "2026-03-13T11:46:02.307+00:00",
133+
"delegated": "no",
134+
"descr": "Storage unit /tmp on node 1 with hostname fab3-apic1 mounted at /tmp is 89% full",
135+
"dn": "topology/pod-1/node-1/sys/ch/p-[/tmp]-f-[tmpfs]/fault-F1528",
136+
"domain": "infra",
137+
"highestSeverity": "major",
138+
"lastTransition": "2026-03-13T11:48:02.867+00:00",
139+
"lc": "raised",
140+
"occur": "1",
141+
"origSeverity": "major",
142+
"prevSeverity": "major",
143+
"rule": "eqpt-storage-full-major",
144+
"severity": "major",
145+
"status": "",
146+
"subject": "equipment-full",
147+
"title": "",
148+
"type": "operational"
149+
}
150+
}
151+
},
152+
153+
{
154+
"faultInst": {
155+
"attributes": {
156+
"ack": "no",
157+
"alert": "no",
158+
"cause": "equipment-full",
159+
"changeSet": "available (Old: 1501496, New: 240908), capUtilized (Old: 79, New: 82), inodesFree (Old: 12148991, New: 12148990), inodesUsed (Old: 721, New: 722), used (Old: 595656, New: 1856244)",
160+
"childAction": "",
161+
"code": "F1527",
162+
"created": "2026-03-13T11:46:02.307+00:00",
163+
"delegated": "no",
164+
"descr": "Storage unit /data/log on Node 1 with hostname fab3-apic1 mounted at /data/log is 82% full",
165+
"dn": "topology/pod-1/node-1/sys/ch/p-[/data/log]-f-[tmpfs]/fault-F1527",
166+
"domain": "infra",
167+
"highestSeverity": "warning",
168+
"lastTransition": "2026-03-13T11:48:02.867+00:00",
169+
"lc": "raised",
170+
"occur": "1",
171+
"origSeverity": "warning",
172+
"prevSeverity": "warning",
173+
"rule": "eqpt-storage-full-warning",
174+
"severity": "warning",
175+
"status": "",
176+
"subject": "equipment-full",
177+
"title": "",
178+
"type": "operational"
179+
}
180+
}
91181
}
92182
]

tests/checks/apic_disk_space_faults_check/Fault_exists_not_raised.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,65 @@
8787
"type": "operational"
8888
}
8989
}
90+
},
91+
92+
{
93+
"faultInst": {
94+
"attributes": {
95+
"ack": "no",
96+
"alert": "no",
97+
"cause": "equipment-full",
98+
"changeSet": "inodesFree (Old: 12167881, New: 12167880), inodesUsed (Old: 64, New: 65)",
99+
"childAction": "",
100+
"code": "F1529",
101+
"created": "2026-03-13T11:46:02.307+00:00",
102+
"delegated": "no",
103+
"descr": "Storage unit /tmp on node 1 with hostname fab3-apic1 mounted at /tmp is 100% full",
104+
"dn": "topology/pod-1/node-1/sys/ch/p-[/tmp]-f-[tmpfs]/fault-F1529",
105+
"domain": "infra",
106+
"highestSeverity": "critical",
107+
"lastTransition": "2026-03-13T11:48:02.867+00:00",
108+
"lc": "retaining",
109+
"occur": "1",
110+
"origSeverity": "critical",
111+
"prevSeverity": "critical",
112+
"rule": "eqpt-storage-full-critical",
113+
"severity": "cleared",
114+
"status": "",
115+
"subject": "equipment-full",
116+
"title": "",
117+
"type": "operational"
118+
}
119+
}
120+
},
121+
122+
{
123+
"faultInst": {
124+
"attributes": {
125+
"ack": "no",
126+
"alert": "no",
127+
"cause": "equipment-full",
128+
"changeSet": "inodesFree (Old: 12167881, New: 12167880), inodesUsed (Old: 64, New: 65)",
129+
"childAction": "",
130+
"code": "F1528",
131+
"created": "2026-03-13T11:46:02.307+00:00",
132+
"delegated": "no",
133+
"descr": "Storage unit /tmp on node 1 with hostname fab3-apic1 mounted at /tmp is 89% full",
134+
"dn": "topology/pod-1/node-1/sys/ch/p-[/tmp]-f-[tmpfs]/fault-F1528",
135+
"domain": "infra",
136+
"highestSeverity": "major",
137+
"lastTransition": "2026-03-13T11:48:02.867+00:00",
138+
"lc": "soaking-clearing",
139+
"occur": "1",
140+
"origSeverity": "major",
141+
"prevSeverity": "major",
142+
"rule": "eqpt-storage-full-major",
143+
"severity": "major",
144+
"status": "",
145+
"subject": "equipment-full",
146+
"title": "",
147+
"type": "operational"
148+
}
149+
}
90150
}
91151
]

tests/checks/apic_disk_space_faults_check/Fault_raised.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,65 @@
8787
"type": "operational"
8888
}
8989
}
90+
},
91+
92+
{
93+
"faultInst": {
94+
"attributes": {
95+
"ack": "no",
96+
"alert": "no",
97+
"cause": "equipment-full",
98+
"changeSet": "inodesFree (Old: 12167881, New: 12167880), inodesUsed (Old: 64, New: 65)",
99+
"childAction": "",
100+
"code": "F1529",
101+
"created": "2026-03-13T11:46:02.307+00:00",
102+
"delegated": "no",
103+
"descr": "Storage unit /tmp on node 1 with hostname fab3-apic1 mounted at /tmp is 100% full",
104+
"dn": "topology/pod-1/node-1/sys/ch/p-[/tmp]-f-[tmpfs]/fault-F1529",
105+
"domain": "infra",
106+
"highestSeverity": "critical",
107+
"lastTransition": "2026-03-13T11:48:02.867+00:00",
108+
"lc": "raised",
109+
"occur": "1",
110+
"origSeverity": "critical",
111+
"prevSeverity": "critical",
112+
"rule": "eqpt-storage-full-critical",
113+
"severity": "critical",
114+
"status": "",
115+
"subject": "equipment-full",
116+
"title": "",
117+
"type": "operational"
118+
}
119+
}
120+
},
121+
122+
{
123+
"faultInst": {
124+
"attributes": {
125+
"ack": "no",
126+
"alert": "no",
127+
"cause": "equipment-full",
128+
"changeSet": "inodesFree (Old: 12167881, New: 12167880), inodesUsed (Old: 64, New: 65)",
129+
"childAction": "",
130+
"code": "F1528",
131+
"created": "2026-03-13T11:46:02.307+00:00",
132+
"delegated": "no",
133+
"descr": "Storage unit /tmp on node 1 with hostname fab3-apic1 mounted at /tmp is 89% full",
134+
"dn": "topology/pod-1/node-1/sys/ch/p-[/tmp]-f-[tmpfs]/fault-F1528",
135+
"domain": "infra",
136+
"highestSeverity": "major",
137+
"lastTransition": "2026-03-13T11:48:02.867+00:00",
138+
"lc": "raised",
139+
"occur": "1",
140+
"origSeverity": "major",
141+
"prevSeverity": "major",
142+
"rule": "eqpt-storage-full-major",
143+
"severity": "major",
144+
"status": "",
145+
"subject": "equipment-full",
146+
"title": "",
147+
"type": "operational"
148+
}
149+
}
90150
}
91151
]

0 commit comments

Comments
 (0)