Compare commits

6 Commits

Author SHA1 Message Date
myron ee0e116963 Add copyright notice 2026-07-26 23:53:37 -05:00
myron adbd1a7a24 Stop flagging parkerslingshotrentals as DOWN: it's intentionally behind a Basic Auth Coming Soon gate during rebuild, so 401 is expected there, not a failure
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 00:51:54 -05:00
myron 73aac8ab01 Fix weather widget location label stuck on Fort Worth: the span was a static HTML placeholder never wired to the API response. Wire loadWeather() to update it from d.location, and correct the fallback text to Weatherford, TX
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 00:45:04 -05:00
myron 646da21b86 Update weather section location to Weatherford, TX 76088 (from Fort Worth)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 19:55:05 -05:00
myron d97a345672 Fix network map duplicate-device bug: drop nmap --send-ip (was causing MAC misattribution/stale ARP entries) and dedupe network_devices by MAC on every scan push so IP changes don't leave orphaned rows
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 19:53:17 -05:00
Claude 141191bcdd Fix jarvis-health.sh: watchdog-restart alerts never deduped or auto-resolved
source_key was minute-stamped (health:wd_restart:YYYYMMDDHHMM), so the same restart event seen across two 5-min cron runs within the logs 6-min lookback window got two different keys -> two alert rows + two emails, and the key never matched a clear_cond call so these rows stayed resolved=0 forever, accumulating in the active-alerts view.

Fixed to a stable key (health:wd_restart), matching the pattern used by the other three checks in this script: raise() now dedups via the existing COUNT..resolved=0 check, and clear_cond() runs when no recent restart line is found.

Verified live: injected a fake watchdog restart log line, ran the script twice -> exactly 1 alert row + 1 email (not 2). Removed the line -> alert auto-resolved (resolved=1).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 07:43:20 -05:00
8 changed files with 21 additions and 6 deletions
+1
View File
@@ -0,0 +1 @@
Property of TomTom Enterprises.
+1 -1
View File
@@ -12,7 +12,7 @@ fi
SUBNET="10.48.200.0/24"
TMPFILE=$(mktemp)
nmap -sn --send-ip "$SUBNET" 2>/dev/null > "$TMPFILE"
nmap -sn "$SUBNET" 2>/dev/null > "$TMPFILE"
if [ ! -s "$TMPFILE" ]; then
echo "$(date): nmap produced no output" >&2
+7 -1
View File
@@ -197,6 +197,11 @@ function collect_all(): array {
'orbisportal' => 'https://orbis.orbishosting.com',
'tomtomgames' => 'https://tomtomgames.com',
];
// Sites intentionally gated behind HTTP Basic Auth (e.g. a password-protected
// "Coming Soon" page during a rebuild) — treat these status codes as up, not down.
$expectedCodes = [
'parkerslingshotrentals' => [401],
];
$down = [];
foreach ($sites as $key => $url) {
$parsed = parse_url($url);
@@ -216,7 +221,8 @@ function collect_all(): array {
curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$status = ($code >= 200 && $code < 400) ? 'up' : "down-$code";
$ok = ($code >= 200 && $code < 400) || in_array($code, $expectedCodes[$key] ?? [], true);
$status = $ok ? 'up' : "down-$code";
KBEngine::storeFact('sites', $key, $status, $url, 180);
if ($status !== 'up') $down[] = "$key($code)";
}
+5
View File
@@ -35,6 +35,11 @@ foreach ($devices as $d) {
if (!$ip) continue;
$discoveredIPs[] = $ip;
if ($mac) {
// Device likely moved to a new IP (DHCP) — drop the stale row so it
// doesn't linger as an orphaned duplicate under the old address.
JarvisDB::execute('DELETE FROM network_devices WHERE mac=? AND ip<>?', [$mac, $ip]);
}
JarvisDB::execute(
'INSERT INTO network_devices (ip, mac, hostname, status, last_seen)
VALUES (?,?,?,?,NOW())
+2 -2
View File
@@ -213,7 +213,7 @@ if ($weatherAge > 1800) {
};
$weatherRaw = curlGet(
'https://wttr.in/FortWorth,TX?format=j1',
'https://wttr.in/76088?format=j1',
['User-Agent: curl/7.88 Jarvis/1.0'],
15
);
@@ -245,7 +245,7 @@ if ($weatherAge > 1800) {
cacheStore('weather', [
'source' => 'wttr.in',
'location' => 'Fort Worth, TX',
'location' => 'Weatherford, TX',
'current' => [
'temp' => (int)($cu['temp_F'] ?? 0),
'feels' => (int)($cu['FeelsLikeF'] ?? 0),
+3 -1
View File
@@ -64,7 +64,9 @@ if [ -f "$WDLOG" ]; then
'match($0,/^\[([0-9-]+ [0-9:]+)\]/,m){ if(m[1]>=cutoff && /restarted successfully/) print }' "$WDLOG")
if [ -n "$RECENT" ]; then
SVC=$(printf '%s' "$RECENT" | grep -oE '(nginx|php8.3-fpm|mariadb|redis-server)' | sort -u | tr '\n' ' ')
raise "health:wd_restart:$(date +%Y%m%d%H%M)" "warning" "Service auto-restarted" "Watchdog restarted: ${SVC:-a service}. Investigate why it died."
raise "health:wd_restart" "warning" "Service auto-restarted" "Watchdog restarted: ${SVC:-a service}. Investigate why it died."
else
clear_cond "health:wd_restart"
fi
fi
+1
View File
@@ -982,6 +982,7 @@ async function loadWeather() {
const d = await api('weather');
if (!d || !d.current) return;
const c = d.current;
if (d.location) document.getElementById('weather-loc').textContent = d.location.toUpperCase();
document.getElementById('weather-temp').textContent = c.temp;
document.getElementById('weather-desc').textContent = (c.desc || '').toUpperCase();
document.getElementById('weather-feels').textContent = c.feels + '°F';
+1 -1
View File
@@ -84,7 +84,7 @@
<div id="leftPanel">
<!-- Weather Widget -->
<div class="panel" style="flex:0 0 auto">
<div class="panel-title">WEATHER <span id="weather-loc" style="font-size:0.55rem;color:var(--text-dim)">FORT WORTH, TX</span></div>
<div class="panel-title">WEATHER <span id="weather-loc" style="font-size:0.55rem;color:var(--text-dim)">WEATHERFORD, TX</span></div>
<div style="display:flex;align-items:flex-start;gap:12px;margin-bottom:8px">
<div style="flex:1">
<div style="display:flex;align-items:baseline;gap:8px">