<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
</head><body>From what I can see, your snmpd system will run /usr/local/bin/pdns_stats as the snmpd user. This user does not have write permission to the /var/run/pdns-recursor directory and so you get the error.<br>You could either make the /var/run/pdns-recursor mode 775 and group snmpd; or maybe add the snmpd user to the pdns group and make the directory mode 775. Note that you also need to have the same mode and ownership on the socket.<br>Hope this helps, sorry for the slow reply have been very busy<br>Steve<br><br>
<blockquote type="cite">
On 09 January 2020 at 18:24 Sharone <missakiiki@gmail.com> wrote:
<br>
<br>
<div dir="ltr">
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
Hello Steve,
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<br>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
I appreciate your response. Below is what is inside /etc/snmp/snmpd.conf file
<br>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<br>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i>rocommunity public<br>syslocation "Data Center"<br>syscontact <a href="mailto:admin@techs.co.ug">admin@techs.co.ug</a><br>createUser admin SHA admin123! AES admin123!<br>rouser admin authPriv<br>extend pdns-rec /usr/local/bin/pdns_stats<br>agentAddress udp:161,udp6:[::1]:161</i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i><br></i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i></i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
/etc/default/snmpd
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i><br></i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i># This file controls the activity of snmpd<br><br># Don't load any MIBs by default.<br># You might comment this lines once you have the MIBs downloaded.<br>export MIBS=<br><br># snmpd control (yes means start daemon).<br>SNMPDRUN=yes<br><br># snmpd options (use syslog, close stdin/out/err).<br>SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid'</i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i><br></i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
snmp service status
<i><br></i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i><br></i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i># systemctl status snmpd.service<br>● snmpd.service - LSB: SNMP agents<br> Loaded: loaded (/etc/init.d/snmpd; bad; vendor preset: enabled)<br> Active: active (running) since Thu 2020-01-09 08:24:04 EAT; 4s ago<br> Docs: man:systemd-sysv-generator(8)<br> Process: 694 ExecStop=/etc/init.d/snmpd stop (code=exited, status=0/SUCCESS)<br> Process: 703 ExecStart=/etc/init.d/snmpd start (code=exited, status=0/SUCCESS)<br> Tasks: 1<br> Memory: 4.3M<br> CPU: 66ms<br> CGroup: /system.slice/snmpd.service<br> └─710 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux mteTrigger mteTriggerConf -p /run/snmpd.pid<br><br>Jan 09 08:24:04 vdns-50 systemd[1]: Starting LSB: SNMP agents...<br>Jan 09 08:24:04 vdns-50 snmpd[703]: * Starting SNMP services:<br>Jan 09 08:24:04 vdns-50 systemd[1]: Started LSB: SNMP agents.<br>Jan 09 08:24:04 vdns-50 snmpd[710]: NET-SNMP version 5.7.3<br></i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<br clear="all">
</div>
<div>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<span style="font-family: trebuchet ms,sans-serif;">Regards,<br></span>
</div>
<div>
<span style="font-family: trebuchet ms,sans-serif;">Sharone</span>
<br>
</div>
</div>
</div>
</div>
<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">
On Wed, 8 Jan 2020 at 22:35, Steve Shipway <
<a href="mailto:steve.shipway@smxemail.com">steve.shipway@smxemail.com</a>> wrote:
<br>
</div>
<blockquote class="gmail_quote">
<div>
<div>
On Wed, 2020-01-08 at 09:20 +0300, Sharone wrote:
</div>
<blockquote type="cite">
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<i><span># snmpwalk -v2c -c public localhost .1.3.6.1.4.1.8072.1.3.2.4.1.2<br></span>iso.3.6.1.4.1.8072.1.3.2.4.1.2.8.112.100.110.115.45.114.101.99.1 = STRING: "Fatal: Unable to generate local temporary file in directory '/var/run/pdns-recursor': Permission denied"</i>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;"></div>
</blockquote>
<div>
<span><br></span>
</div>
<div>
<span>A couple of thoughts here . Either</span>
</div>
<div>
<span>- SElinux is doing its magic and blocking - this should be logged in the syslog if so, or</span>
</div>
<div>
<span>- Your SNMP is running with chroot enabled and /var/run/pdns-recursor doesn't exist in the chroot environment</span>
</div>
<div>
<span>- rec_control is trying to generate a tmp file as the snmp user so doesn't have write permission.</span>
</div>
<div>
<span>- Your SNMP daemon is using a temporary file for the rec_control output which it is trying to put in /var/run/pdns-recursor</span>
</div>
<div>
<span><br></span>
</div>
<div>
Being able to see your snmp daemon configuration would probably help with diagnosing this, so please post it here if possible.
</div>
<div>
<br>
</div>
<div>
Steve
</div>
<div>
<span><br></span>
</div>
<div>
<span><br></span>
</div>
<div>
<span>-- <br><strong style="color: rgb(40,91,167); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;">Steve Shipway | </strong><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"></span><span style="color: rgb(40,91,167); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;">Senior Email Systems Administrator</span><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"> </span><br style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"><strong style="color: rgb(40,91,167); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;">Phone:</strong><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"> +64 9 302 0515 </span><strong style="color: rgb(40,91,167); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;">Fax:</strong><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"> +64 9 302 0518 </span><br style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"><strong style="color: rgb(40,91,167); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;">Freephone:</strong><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"> 0800 SMX SMX (769 769) </span><br style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"><strong style="color: rgb(40,91,167); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;">SMX Limited:</strong><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"> </span><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;">Level 10, 19 Victoria Street West, Auckland, New Zealand</span><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"> </span><br style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"><strong style="color: rgb(40,91,167); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;">Web:</strong><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"> </span><a href="http://smxemail.com/" style="color: rgb(40,91,167); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;" target="_blank">http://smxemail.com</a><span style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"> </span><br style="color: rgb(130,129,129); font-family: Segoe,"Myriad Pro",Arial,sans-serif; font-size: 14px;"><img><br></span>
</div>
<div>
<div style="border-top: 1px solid black; border-bottom: 1px solid black; padding: 10px 0px; margin: 20px 0px; font-size: 9pt;">
<span style="font-family: Verdana,Arial,Helvetica,sans-serif;">This email has been</span>
<font face="arial"><font face="Verdana, Arial, Helvetica, sans-serif"> filtered by SMX. For more information visit </font><a href="http://smxemail.com/" target="_blank">smxemail.com</a><font face="verdana"><br></font></font>
</div>
</div>
</div>_______________________________________________
<br> Pdns-users mailing list
<br>
<a href="mailto:Pdns-users@mailman.powerdns.com" target="_blank">Pdns-users@mailman.powerdns.com</a>
<br>
<a href="https://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">https://mailman.powerdns.com/mailman/listinfo/pdns-users</a>
<br>
</blockquote>
</div>
</blockquote>
<br> <div><div style="border-top-style: solid; border-top-width: 1px; border-top-color: black; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: black; padding: 10px 0px; margin: 20px 0px; font-size: 9pt;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;">This email has been</span><font face="arial"><font face="Verdana, Arial, Helvetica, sans-serif"> filtered by SMX. For more information visit </font><a href="http://smxemail.com/" font-size:="" 9pt;"="">smxemail.com</a><font face="verdana"><br></font></font></div>
</div>
</body></html>