  In this paper, we for the first time obtain characterization of four
fundamental notions of detectability for general labeled weighted automata over
monoids (denoted by $\mathcal{A}^{\mathfrak{M}}$ for short), where the four
notions are strong (periodic) detectability (SD and SPD) and weak (periodic)
detectability (WD and WPD). Firstly, we formulate the notions of concurrent
composition, observer, and detector for $\mathcal{A}^{\mathfrak{M}}$. Secondly,
we use the concurrent composition to give an equivalent condition for SD, use
the detector to give an equivalent condition for SPD, and use the observer to
give equivalent conditions for WD and WPD, all for general
$\mathcal{A}^{\mathfrak{M}}$ without any assumption. Thirdly, we prove that for
a labeled weighted automaton over monoid $(\mathbb{Q}^k,+)$ (denoted by
$\mathcal{A}^{\mathbb{Q}^k}$), its concurrent composition, observer, and
detector can be computed in NP, $2$-EXPTIME, and $2$-EXPTIME, respectively, by
developing novel connections between $\mathcal{A}^{\mathbb{Q}^k}$ and the
NP-complete exact path length problem (proved by [Nyk\"{a}nen and Ukkonen,
2002]) and a subclass of Presburger arithmetic. As a result, we prove that for
$\mathcal{A}^{\mathbb{Q}^k}$, SD can be verified in coNP, while SPD, WD, and
WPD can be verified in $2$-EXPTIME. Finally, we prove that the problems of
verifying SD and SPD of deterministic, deadlock-free, and divergence-free
$\mathcal{A}^{\mathbb{N}}$ over monoid $(\mathbb{N},+)$ are both coNP-hard.
  The developed original methods will provide foundations for characterizing
other fundamental properties (e.g., diagnosability, opacity) for
$\mathcal{A}^{\mathfrak{M}}$. We also initially explore detectability in
labeled timed automata, and prove that the SD verification problem is
PSPACE-complete, while WD and WPD are undecidable.
