Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need a suggestion on how to make this to work.

We have a print server which has some "pcl to pdf" converter application that listens on port 9001, collects PCL jobs and creates PDF from PCL. The problem is that pcl to pdf application does not support SNMP. As all this happens in citrix environment citrix uses snmp protocol to query printer status. We can't disable SNMP in citrix because of an IT restriction. Because of all that printer is reported as offline for all users and it can't be used.

When we put packet capture on our machine we see some printer traps/oids:

1.3.6.1.2.1.25.3.2.1.5.1

1.3.6.1.2.1.25.3.5.1.1.1

1.3.6.1.2.1.25.3.5.1.2.1

If we could somehow simulate printer responses for snmp queries on above OIDs that would solve our issue.

Any suggestions?

share|improve this question
    
Does the printer show as Online or Offline from the Print Server itself? This doesn't sound like a Citrix related issue at all, so what happens on another server that can see the printer? What Operating Systems are involved? –  Dan Feb 13 '12 at 13:34
    
The thing is that application is listening printer port 9001, and it does only that. The application simulates printer and it does not support SNMP. So, there is no actually printer installed in printers and devices on the print server. We believe the operating system is Windows 2000. Unfortuately we do not have access to the servers and our client does not want to approach the IT vendor. But have to provide a client print solution. –  HABJAN Feb 13 '12 at 14:00
    
This makes no sense - if it's simulating a printer, then there must be something installed in Printers & Devices. This concept isn't new, but this does sound like an issue with the software. –  Dan Feb 13 '12 at 14:16
    
Here you can find more about software we use (Brooks Net RPM): brooksnet.com –  HABJAN Feb 13 '12 at 14:47
    
A (little complicated) idea: Set up a linux box as a private firewall to the print server. Configure it with the printer server's IP, give the print server a private IP. Do a DNAT configuration (with iptables, the PS has the linux box as default route) from the linux box to the PS on Port 9001. The SNMP port on the linux port is proxied to an existing working printer (with this: net-snmp.org/wiki/index.php/Snmpd_proxy). Voila! the only problem would be that the PS won't work if the proxies printer is unavailable. –  AndreasM Feb 14 '12 at 12:49

1 Answer 1

up vote 0 down vote accepted

I managed to find a solution for my problem.

I downloaded #SNMP (C# Based Open Source SNMP) which contains SNMPD project ( SNMP Agent ) and then i wrote a couple of classes that handles OID's that i had to respond to.

Based on: http://www.oid-info.com/get/1.3.6.1.2.1.25.3.2.1.5

public class hrDeviceStatus : ScalarObject
{
    private readonly Integer32 _value = new Integer32(2); // running 2

    public hrDeviceStatus()
        : base(new ObjectIdentifier("1.3.6.1.2.1.25.3.2.1.5.1"))
    {
    }

    public override ISnmpData Data
    {
        get 
        {
            return _value; 
        }
        set {  }
    }
}

Based on: http://www.oid-info.com/get/1.3.6.1.2.1.25.3.5.1.1

public class hrPrinterStatus : ScalarObject
{
    private readonly Integer32 _value = new Integer32(1); // other

    public hrPrinterStatus()
        : base(new ObjectIdentifier("1.3.6.1.2.1.25.3.5.1.1.1"))
    {
    }

    public override ISnmpData Data
    {
        get 
            { 
                return _value; 
            }
        set { }
    }
}

Based on: http://www.oid-info.com/get/1.3.6.1.2.1.25.3.5.1.2

public class hrPrinterDetectedErrorState : ScalarObject
{
    private readonly OctetString _value = new OctetString("\0\0"); // all 16 bits set to 0 

    public hrPrinterDetectedErrorState()
        : base(new ObjectIdentifier("1.3.6.1.2.1.25.3.5.1.2.1"))
    {
    }

    public override ISnmpData Data
    {
        get 
        { 
            return _value; 
        }
        set { }
    }
}

And then i added them to the object store.

    var store = Container.Resolve<ObjectStore>();
    store.Add(new hrDeviceStatus());
    store.Add(new hrPrinterStatus());
    store.Add(new hrPrinterDetectedErrorState());

That's all. Thanks everyone that tried to help.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.