~ubuntu-branches/ubuntu/natty/net-snmp/natty

« back to all changes in this revision

Viewing changes to debian/source.apport

  • Committer: James Westby
  • Date: 2010-03-31 03:44:28 UTC
  • mfrom: (40.1.1 net-snmp-apport-533603)
  • Revision ID: james.westby@canonical.com-20100331034428-6w0j3zdd1q9ys636
Tags: 5.4.2.1~dfsg0ubuntu1-0ubuntu2
Add an apport hook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
'''apport hook for net-snmp
 
4
 
 
5
(c) 2010 Andres Rodriguez
 
6
Author: Andres Rodriguez <andreserl@ubuntu.com>
 
7
 
 
8
This program is free software; you can redistribute it and/or modify it
 
9
under the terms of the GNU General Public License as published by the
 
10
Free Software Foundation; either version 2 of the License, or (at your
 
11
option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
 
12
the full text of the license.
 
13
'''
 
14
 
 
15
from apport.hookutils import *
 
16
import re
 
17
 
 
18
def add_info(report, ui):
 
19
    response = ui.yesno("The contents of your /etc/snmp/snmpd.conf and "
 
20
                        "your /etc/snmp/snmptrapd.conf files may help "
 
21
                        "developers diagnose your bug more quickly.  "
 
22
                        "However, it may contain sensitive information.  "
 
23
                        "Do you want to include it in your bug report?")
 
24
 
 
25
    if response == None: # user cancelled
 
26
        raise StopIteration
 
27
 
 
28
    elif response == True:
 
29
        attach_conffiles(report, 'snmpd')
 
30
 
 
31
        # get version
 
32
        report['SNMPVersion'] = root_command_output(['/usr/sbin/snmpd', '-v'])
 
33
 
 
34
        # get syslog stuff
 
35
        report['SyslogSnmpd'] = recent_syslog(re.compile('snmpd\['))
 
36
        report['SyslogSnmptrapd'] = recent_syslog(re.compile('snmptrapd\['))