Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/freenas/usr/local/bin/pkg_mgmt_disabled
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

echo "Package management tools are disabled on TrueNAS appliances."
echo
echo "Attempting to update SCALE with apt or methods other than the SCALE web"
echo "Attempting to update TrueNAS with apt or methods other than the TrueNAS web"
echo "interface can result in a nonfunctional system."
exit 1
2 changes: 1 addition & 1 deletion src/freenas/usr/local/libexec/disable-rootfs-protection
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ if __name__ == '__main__':
# environment.
if rv.stdout.decode().strip() != 'on' and not args.force:
with Client() as c:
if c.call('system.product_type') == ProductType.SCALE_ENTERPRISE:
if c.call('system.product_type') == ProductType.ENTERPRISE:
print((
'Root filesystem protections may not be administratively disabled '
'on Enterprise-licensed TrueNAS products. Circumventing this '
Expand Down
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/alert/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AlertClass(metaclass=AlertClassMeta):
text = None

exclude_from_list = False
products = ("CORE", "ENTERPRISE", ProductType.SCALE, ProductType.SCALE_ENTERPRISE)
products = (ProductType.COMMUNITY_EDITION, ProductType.ENTERPRISE)
proactive_support = False
proactive_support_notify_gone = False

Expand Down Expand Up @@ -310,7 +310,7 @@ class AlertSource:

schedule = IntervalSchedule(timedelta())

products = ("CORE", "ENTERPRISE", ProductType.SCALE, ProductType.SCALE_ENTERPRISE)
products = (ProductType.COMMUNITY_EDITION, ProductType.ENTERPRISE)
failover_related = False
run_on_backup_node = True

Expand Down
2 changes: 1 addition & 1 deletion src/middlewared/middlewared/alert/source/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def audit_entry_to_msg(entry):
class AdminSessionAlertSource(AlertSource):
schedule = CrontabSchedule(hour=1) # every 24 hours
run_on_backup_node = True
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)

async def check(self):
now = int(time())
Expand Down
5 changes: 3 additions & 2 deletions src/middlewared/middlewared/alert/source/cores.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from middlewared.alert.base import AlertClass, AlertCategory, AlertLevel, AlertSource, Alert
from middlewared.utils import ProductType


class CoreFilesArePresentAlertClass(AlertClass):
Expand All @@ -12,11 +13,11 @@ class CoreFilesArePresentAlertClass(AlertClass):
"and attach the core files and debug. After creating the ticket, the core files can be removed "
"from the system by opening shell and entering 'rm /var/db/system/cores/*'."
)
products = ("SCALE",)
products = (ProductType.COMMUNITY_EDITION,)


class CoreFilesArePresentAlertSource(AlertSource):
products = ("SCALE",)
products = (ProductType.COMMUNITY_EDITION,)

async def should_alert(self, core):
if core["corefile"] != "present" or not core["unit"]:
Expand Down
6 changes: 3 additions & 3 deletions src/middlewared/middlewared/alert/source/enclosure_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ class EnclosureUnhealthyAlertClass(AlertClass):
level = AlertLevel.CRITICAL
title = "Enclosure Status Is Not Healthy"
text = 'Enclosure (%s): Element "%s" is reporting a status of "%s" with a value of "%s". (raw value "%s")'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class EnclosureHealthyAlertClass(AlertClass):
category = AlertCategory.HARDWARE
level = AlertLevel.INFO
title = "Enclosure Status Is Healthy"
text = "Enclosure (%s) is healthy."
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class EnclosureStatusAlertSource(AlertSource):
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
failover_related = True
run_on_backup_node = False
bad = ("critical", "noncritical", "unknown", "unrecoverable")
Expand Down
12 changes: 6 additions & 6 deletions src/middlewared/middlewared/alert/source/failover.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,43 @@ class FailoverInterfaceNotFoundAlertClass(AlertClass):
level = AlertLevel.CRITICAL
title = 'Failover Internal Interface Not Found'
text = 'Failover internal interface not found. Contact support.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class TrueNASVersionsMismatchAlertClass(AlertClass):
category = AlertCategory.HA
level = AlertLevel.CRITICAL
title = 'TrueNAS Software Versions Must Match Between Storage Controllers'
text = 'TrueNAS software versions must match between storage controllers.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class FailoverStatusCheckFailedAlertClass(AlertClass):
category = AlertCategory.HA
level = AlertLevel.CRITICAL
title = 'Failed to Check Failover Status with the Other Controller'
text = 'Failed to check failover status with the other controller: %s.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class FailoverFailedAlertClass(AlertClass):
category = AlertCategory.HA
level = AlertLevel.CRITICAL
title = 'Failover Failed'
text = 'Failover failed. Check /var/log/failover.log on both controllers.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class VRRPStatesDoNotAgreeAlertClass(AlertClass):
category = AlertCategory.HA
level = AlertLevel.CRITICAL
title = 'Controllers VRRP States Do Not Agree'
text = 'Controllers VRRP states do not agree: %(error)s.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class FailoverAlertSource(AlertSource):
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
failover_related = True
run_on_backup_node = False

Expand Down
6 changes: 3 additions & 3 deletions src/middlewared/middlewared/alert/source/failover_disks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ class DisksAreNotPresentOnStandbyNodeAlertClass(AlertClass):
level = AlertLevel.CRITICAL
title = TITLE + 'Standby Storage Controller'
text = TEXT + 'active storage controller but missing on standby storage controller.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class DisksAreNotPresentOnActiveNodeAlertClass(AlertClass):
category = AlertCategory.HA
level = AlertLevel.CRITICAL
title = TITLE + 'Active Storage Controller'
text = TEXT + 'standby storage controller but missing on active storage controller.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class FailoverDisksAlertSource(AlertSource):
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
failover_related = True
run_on_backup_node = False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class NoCriticalFailoverInterfaceFoundAlertClass(AlertClass):
level = AlertLevel.CRITICAL
title = 'At Least 1 Network Interface Is Required To Be Marked Critical For Failover'
text = 'At least 1 network interface is required to be marked critical for failover.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class FailoverCriticalAlertSource(AlertSource):
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
failover_related = True
run_on_backup_node = False

Expand Down
6 changes: 3 additions & 3 deletions src/middlewared/middlewared/alert/source/failover_nics.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ class NetworkCardsMismatchOnStandbyNodeAlertClass(AlertClass):
level = AlertLevel.CRITICAL
title = TITLE + 'Standby Storage Controller'
text = TEXT + 'active storage controller but missing on standby storage controller.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class NetworkCardsMismatchOnActiveNodeAlertClass(AlertClass):
category = AlertCategory.HA
level = AlertLevel.CRITICAL
title = TITLE + 'Active Storage Controller'
text = TEXT + 'standby storage controller but missing on active storage controller.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class FailoverNetworkCardsAlertSource(AlertSource):
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
failover_related = True
run_on_backup_node = False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class FailoverRemoteSystemInaccessibleAlertClass(AlertClass):
level = AlertLevel.CRITICAL
title = 'Other Controller is Inaccessible'
text = 'Other TrueNAS controller is inaccessible. Contact support. Incident ID: %s.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
proactive_support = True
proactive_support_notify_gone = True


class FailoverRemoteSystemInaccessibleAlertSource(AlertSource):
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
failover_related = True
run_on_backup_node = False

Expand Down
6 changes: 3 additions & 3 deletions src/middlewared/middlewared/alert/source/failover_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FailoverSyncFailedAlertClass(AlertClass, SimpleOneShotAlertClass):
"the standby storage controller but failed. Use Sync to Peer on the "
"System/Failover page to try and perform a manual sync."
)
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)

async def create(self, args):
return Alert(FailoverSyncFailedAlertClass, {'mins': args['mins']})
Expand All @@ -37,7 +37,7 @@ class FailoverKeysSyncFailedAlertClass(AlertClass, SimpleOneShotAlertClass):
"The automatic synchronization of encryption passphrases with the standby "
"controller has failed. Please go to System > Failover and manually sync to peer."
)
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class FailoverKMIPKeysSyncFailedAlertClass(AlertClass, OneShotAlertClass):
Expand All @@ -50,7 +50,7 @@ class FailoverKMIPKeysSyncFailedAlertClass(AlertClass, OneShotAlertClass):
"The automatic synchronization of KMIP keys with the standby "
"controller has failed due to %(error)s. Please go to System > Failover and manually sync to peer."
)
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)

async def create(self, args):
return Alert(FailoverKMIPKeysSyncFailedAlertClass, args)
Expand Down
10 changes: 5 additions & 5 deletions src/middlewared/middlewared/alert/source/jbof.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,35 @@ class JBOFRedfishCommAlertClass(AlertClass):
level = AlertLevel.CRITICAL
title = 'Failed to Communicate with JBOF'
text = 'JBOF: "%(desc)s" (%(ip1)s/%(ip2)s) Failed to communicate with redfish interface.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class JBOFInvalidDataAlertClass(AlertClass):
category = AlertCategory.HARDWARE
level = AlertLevel.CRITICAL
title = 'JBOF has invalid data'
text = 'JBOF: "%(desc)s" (%(ip1)s/%(ip2)s) does not provide valid data for: %(keys)s'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class JBOFElementWarningAlertClass(AlertClass):
category = AlertCategory.HARDWARE
level = AlertLevel.WARNING
title = 'JBOF element non-critical'
text = 'JBOF: "%(desc)s" (%(ip1)s/%(ip2)s) %(etype)s %(key)s is noncritical: %(value)s'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class JBOFElementCriticalAlertClass(AlertClass):
category = AlertCategory.HARDWARE
level = AlertLevel.CRITICAL
title = 'JBOF element critical'
text = 'JBOF: "%(desc)s" (%(ip1)s/%(ip2)s) %(etype)s %(key)s is critical: %(value)s'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class JBOFAlertSource(AlertSource):
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
run_on_backup_node = False
schedule = IntervalSchedule(datetime.timedelta(minutes=5))

Expand Down
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/alert/source/legacy_mini_bmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class TrueNASMiniBMCAlertClass(AlertClass):
f"<a href=\"{URL}\" target=\"_blank\">"
"ASRock Rack C2750D4I BMC Watchdog Issue</a> for details."
)
products = (ProductType.SCALE,)
products = (ProductType.COMMUNITY_EDITION,)


class TrueNASMiniBMCAlertSource(AlertSource):
products = (ProductType.SCALE,)
products = (ProductType.COMMUNITY_EDITION,)

async def check(self):
dmi = await self.middleware.call("system.dmidecode_info")
Expand Down
8 changes: 4 additions & 4 deletions src/middlewared/middlewared/alert/source/license_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ class LicenseAlertClass(AlertClass):
level = AlertLevel.CRITICAL
title = "TrueNAS License Issue"
text = "%s"
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class LicenseIsExpiringAlertClass(AlertClass):
category = AlertCategory.SYSTEM
level = AlertLevel.WARNING
title = "TrueNAS License Is Expiring"
text = "%s"
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class LicenseHasExpiredAlertClass(AlertClass):
category = AlertCategory.SYSTEM
level = AlertLevel.CRITICAL
title = "TrueNAS License Has Expired"
text = "%s"
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)


class LicenseStatusAlertSource(ThreadedAlertSource):
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
run_on_backup_node = False
schedule = IntervalSchedule(timedelta(hours=24))

Expand Down
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/alert/source/memory_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MemoryErrorsAlertClass(AlertClass):
level = AlertLevel.WARNING
title = 'Uncorrected Memory Errors Detected'
text = '%(count)d total uncorrected errors detected for %(loc)s.'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
proactive_support = True


Expand All @@ -23,7 +23,7 @@ class MemorySizeMismatchAlertClass(AlertClass):
level = AlertLevel.WARNING
title = 'Memory Size Mismatch Detected'
text = 'Memory size on this controller %(r1)s doesn\'t match other controller %(r2)s'
products = (ProductType.SCALE_ENTERPRISE,)
products = (ProductType.ENTERPRISE,)
proactive_support = True


Expand Down
Loading
Loading