Add bw, dns, and uptime checks.
[myops.git] / web / collect / client / DNS / Status.py
1 """
2  $Id: Status.py,v 1.7.2.1 2011/03/16 20:06:39 customdesigned Exp $
3
4  This file is part of the pydns project.
5  Homepage: http://pydns.sourceforge.net
6
7  This code is covered by the standard Python License. See LICENSE for details.
8
9  Status values in message header
10 """
11
12 NOERROR   = 0 #   No Error                           [RFC 1035]
13 FORMERR   = 1 #   Format Error                       [RFC 1035]
14 SERVFAIL  = 2 #   Server Failure                     [RFC 1035]
15 NXDOMAIN  = 3 #   Non-Existent Domain                [RFC 1035]
16 NOTIMP    = 4 #   Not Implemented                    [RFC 1035]
17 REFUSED   = 5 #   Query Refused                      [RFC 1035]
18 YXDOMAIN  = 6 #   Name Exists when it should not     [RFC 2136]
19 YXRRSET   = 7 #   RR Set Exists when it should not   [RFC 2136]
20 NXRRSET   = 8 #   RR Set that should exist does not  [RFC 2136]
21 NOTAUTH   = 9 #   Server Not Authoritative for zone  [RFC 2136]
22 NOTZONE   = 10 #  Name not contained in zone         [RFC 2136]
23 BADVERS   = 16 #  Bad OPT Version                    [RFC 2671]
24 BADSIG    = 16 #  TSIG Signature Failure             [RFC 2845]
25 BADKEY    = 17 #  Key not recognized                 [RFC 2845]
26 BADTIME   = 18 #  Signature out of time window       [RFC 2845]
27 BADMODE   = 19 #  Bad TKEY Mode                      [RFC 2930]
28 BADNAME   = 20 #  Duplicate key name                 [RFC 2930]
29 BADALG    = 21 #  Algorithm not supported            [RFC 2930]
30
31 # Construct reverse mapping dictionary
32
33 _names = dir()
34 statusmap = {}
35 for _name in _names:
36     if _name[0] != '_': statusmap[eval(_name)] = _name
37
38 def statusstr(status):
39     if statusmap.has_key(status): return statusmap[status]
40     else: return `status`
41
42 #
43 # $Log: Status.py,v $
44 # Revision 1.7.2.1  2011/03/16 20:06:39  customdesigned
45 # Refer to explicit LICENSE file.
46 #
47 # Revision 1.7  2002/04/23 12:52:19  anthonybaxter
48 # cleanup whitespace.
49 #
50 # Revision 1.6  2002/04/23 10:57:57  anthonybaxter
51 # update to complete the list of response codes.
52 #
53 # Revision 1.5  2002/03/19 12:41:33  anthonybaxter
54 # tabnannied and reindented everything. 4 space indent, no tabs.
55 # yay.
56 #
57 # Revision 1.4  2002/03/19 12:26:13  anthonybaxter
58 # death to leading tabs.
59 #
60 # Revision 1.3  2001/08/09 09:08:55  anthonybaxter
61 # added identifying header to top of each file
62 #
63 # Revision 1.2  2001/07/19 06:57:07  anthony
64 # cvs keywords added
65 #
66 #