diff --git a/vip-helpers/vip-notoptions-mitigation.php b/vip-helpers/vip-notoptions-mitigation.php new file mode 100644 index 0000000000..fe7fb72ce4 --- /dev/null +++ b/vip-helpers/vip-notoptions-mitigation.php @@ -0,0 +1,92 @@ +blogid ) ? ", blog ID {$wpdb->blogid}" : '' ), + ( $flushed ? '' : 'un' ) + ); + + $to_irc = $subject . ' [https://wp.me/PCYsg-vqN] #vipnotoptions'; + + // Send to IRC, if we have a host configured + if ( defined( 'ALERT_SERVICE_ADDRESS' ) && ALERT_SERVICE_ADDRESS ) { + + $alerts = Alerts::instance(); + $alerts->send_to_chat( '#vip-deploy-on-call', $to_irc, $irc_alert_level, 'a8c-notoptions' ); + + if ( 'production' === $environment ) { + + // Send to OpsGenie + $alerts->opsgenie( + $subject, + array( + 'alias' => 'notoptions/cache-corruption/' . $site_id, + 'description' => 'Invalid values found in notoptions cache', + 'entity' => (string) $site_id, + 'priority' => $opsgenie_alert_level, + 'source' => 'sites/notoptions-value-monitor', + ), + 'notoptions-value-alert', + '10' + ); + + } + } + } + } +}